Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kool-dev/kool
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Jul 7, 2020
2 parents eb15c2e + 4817533 commit 814e9ac
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 20 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,29 @@ Execute command in running container.
### kool run

```bash
$ kool run [script/image] [command]
$ kool run [script] [command]
```

Execute script or a docker image.

| Name | Type | Description |
| ---- | ---- | ----------- |
| `script/image` | `string` | Script to run within your `kool.yaml` file.|
| `script` | `string` | Script to run within your `kool.yaml` file. |
| `command` | `string` | The command to run, i.e: `composer install`, `yarn install` |
| `--docker` | `none` | If enabled, `script` param will become `image` and you will run a docker image |

### kool docker

```bash
$ kool docker [image] [command]
```

Execute script or a docker image.

| Name | Type | Description |
| ---- | ---- | ----------- |
| `image` | `string` | Docker image to run, i.e: `fireworkweb/node:14` |
| `command` | `string` | The command to run, i.e: `composer install`, `yarn install` |
| `--disable-tty|-T` | `none` | Force disable tty, good for CI/CI/Automation |

### kool stop

Expand Down
2 changes: 1 addition & 1 deletion cmd/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var dockerFlags = &DockerFlags{false}
func init() {
rootCmd.AddCommand(dockerCmd)

dockerCmd.Flags().BoolVarP(&dockerFlags.DisableTty, "disable-tty", "T", false, "Disables TTY (only in case of using --docker)")
dockerCmd.Flags().BoolVarP(&dockerFlags.DisableTty, "disable-tty", "T", false, "Disables TTY")
}

func runDocker(cmd *cobra.Command, originalArgs []string) {
Expand Down
16 changes: 8 additions & 8 deletions cmd/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ APP_URL=http://localhost:${PORT}`,
install:
- cp .env.example .env
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start`,
}
presets["adonis"] = map[string]string{
Expand Down Expand Up @@ -197,7 +197,7 @@ APP_URL=http://localhost:${PORT}`,
install:
- cp .env.example .env
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start`,
}
presets["laravel"] = map[string]string{
Expand Down Expand Up @@ -263,8 +263,8 @@ networks:
php: kool exec app php
composer: kool exec app composer
node: kool run --docker fireworkweb/node:14 node
npm: kool run --docker fireworkweb/node:14 npm # can change to: yarn,pnpm
node: kool docker fireworkweb/node:14 node
npm: kool docker fireworkweb/node:14 npm # can change to: yarn,pnpm
install:
- kool start
Expand Down Expand Up @@ -319,7 +319,7 @@ networks:
npm: kool exec app npm # can change to: yarn,pnpm
install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start`,
}
presets["nextjs"] = map[string]string{
Expand Down Expand Up @@ -359,7 +359,7 @@ networks:
npm: kool exec app npm # can change to: yarn,pnpm
install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start`,
}
presets["nuxtjs-static"] = map[string]string{
Expand Down Expand Up @@ -406,7 +406,7 @@ networks:
npm: kool exec app npm # can change to: yarn,pnpm
install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start`,
}
presets["nuxtjs"] = map[string]string{
Expand Down Expand Up @@ -451,7 +451,7 @@ networks:
npm: kool exec app npm # can change to: yarn,pnpm
install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start`,
}
}
2 changes: 1 addition & 1 deletion presets/adonis-nextjs/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ scripts:

install:
- cp .env.example .env
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start
2 changes: 1 addition & 1 deletion presets/adonis/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ scripts:

install:
- cp .env.example .env
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start
4 changes: 2 additions & 2 deletions presets/laravel/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ scripts:
php: kool exec app php
composer: kool exec app composer

node: kool run --docker fireworkweb/node:14 node
npm: kool run --docker fireworkweb/node:14 npm # can change to: yarn,pnpm
node: kool docker fireworkweb/node:14 node
npm: kool docker fireworkweb/node:14 npm # can change to: yarn,pnpm

install:
- kool start
Expand Down
2 changes: 1 addition & 1 deletion presets/nextjs-static/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ scripts:
npm: kool exec app npm # can change to: yarn,pnpm

install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start
2 changes: 1 addition & 1 deletion presets/nextjs/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ scripts:
npm: kool exec app npm # can change to: yarn,pnpm

install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start
2 changes: 1 addition & 1 deletion presets/nuxtjs-static/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ scripts:
npm: kool exec app npm # can change to: yarn,pnpm

install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start
2 changes: 1 addition & 1 deletion presets/nuxtjs/kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ scripts:
npm: kool exec app npm # can change to: yarn,pnpm

install:
- kool run --docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool docker fireworkweb/node:14 npm install # can change to: yarn,pnpm
- kool start

0 comments on commit 814e9ac

Please sign in to comment.