Skip to content

Commit

Permalink
feat(container): add command option
Browse files Browse the repository at this point in the history
Added `command` and `hotReloadCommand` fields to container module
configs to go with `args` and `hotReloadArgs`  (on services, test
configs and tasks).

For the k8s plugins, `command` corresponds to the `command` field on k8s
podspecs, i.e. it's the "entrypoint" which `args` are passed to.

This is useful e.g. when some other entrypoint than `/bin/sh -c` is
desired.
  • Loading branch information
thsig committed Jun 13, 2019
1 parent c102919 commit afbd953
Show file tree
Hide file tree
Showing 16 changed files with 277 additions and 57 deletions.
87 changes: 86 additions & 1 deletion docs/reference/module-types/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@ Annotations to attach to the service (Note: May not be applicable to all provide
| Type | Required |
| ---- | -------- |
| `object` | No
### `services[].command[]`
[services](#services) > command

The command/entrypoint to run the container with when starting the service.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- command:
- /bin/sh
- '-c'
```
### `services[].args[]`
[services](#services) > args

Expand All @@ -273,6 +289,14 @@ The arguments to run the container with when starting the service.
| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- args:
- npm
- start
```
### `services[].daemon`
[services](#services) > daemon

Expand Down Expand Up @@ -396,14 +420,39 @@ Set this to check the service's health by checking if this TCP port is accepting
| Type | Required |
| ---- | -------- |
| `string` | No
### `services[].hotReloadCommand[]`
[services](#services) > hotReloadCommand

If this module uses the `hotReload` field, the container will be run with this command/entrypoint when the service is deployed with hot reloading enabled.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- hotReloadCommand:
- /bin/sh
- '-c'
```
### `services[].hotReloadArgs[]`
[services](#services) > hotReloadArgs

If this module uses the `hotReload` field, the container will be run with these arguments instead of those in `args` when the service is deployed with hot reloading enabled.
If this module uses the `hotReload` field, the container will be run with these arguments when the service is deployed with hot reloading enabled.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- hotReloadArgs:
- npm
- run
- dev
```
### `services[].limits`
[services](#services) > limits

Expand Down Expand Up @@ -563,6 +612,22 @@ Maximum duration (in seconds) of the test run.
| Type | Required |
| ---- | -------- |
| `number` | No
### `tests[].command[]`
[tests](#tests) > command

The command/entrypoint used to run the test inside the container.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
tests:
- command:
- /bin/sh
- '-c'
```
### `tests[].args[]`
[tests](#tests) > args

Expand Down Expand Up @@ -626,6 +691,22 @@ Maximum duration (in seconds) of the task's execution.
| Type | Required |
| ---- | -------- |
| `number` | No
### `tasks[].command[]`
[tasks](#tasks) > command

The command/entrypoint used to run the task inside the container.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
tasks:
- command:
- /bin/sh
- '-c'
```
### `tasks[].args[]`
[tasks](#tasks) > args

Expand Down Expand Up @@ -680,6 +761,7 @@ services:
- name:
dependencies: []
annotations: {}
command:
args:
daemon: false
ingresses:
Expand All @@ -695,6 +777,7 @@ services:
scheme: HTTP
command:
tcpPort:
hotReloadCommand:
hotReloadArgs:
limits:
cpu: 1000
Expand All @@ -714,13 +797,15 @@ tests:
- name:
dependencies: []
timeout: null
command:
args:
env: {}
tasks:
- name:
description:
dependencies: []
timeout: null
command:
args:
env: {}
```
87 changes: 86 additions & 1 deletion docs/reference/module-types/maven-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,22 @@ Annotations to attach to the service (Note: May not be applicable to all provide
| Type | Required |
| ---- | -------- |
| `object` | No
### `services[].command[]`
[services](#services) > command

The command/entrypoint to run the container with when starting the service.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- command:
- /bin/sh
- '-c'
```
### `services[].args[]`
[services](#services) > args

Expand All @@ -278,6 +294,14 @@ The arguments to run the container with when starting the service.
| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- args:
- npm
- start
```
### `services[].daemon`
[services](#services) > daemon

Expand Down Expand Up @@ -401,14 +425,39 @@ Set this to check the service's health by checking if this TCP port is accepting
| Type | Required |
| ---- | -------- |
| `string` | No
### `services[].hotReloadCommand[]`
[services](#services) > hotReloadCommand

If this module uses the `hotReload` field, the container will be run with this command/entrypoint when the service is deployed with hot reloading enabled.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- hotReloadCommand:
- /bin/sh
- '-c'
```
### `services[].hotReloadArgs[]`
[services](#services) > hotReloadArgs

If this module uses the `hotReload` field, the container will be run with these arguments instead of those in `args` when the service is deployed with hot reloading enabled.
If this module uses the `hotReload` field, the container will be run with these arguments when the service is deployed with hot reloading enabled.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
services:
- hotReloadArgs:
- npm
- run
- dev
```
### `services[].limits`
[services](#services) > limits

Expand Down Expand Up @@ -568,6 +617,22 @@ Maximum duration (in seconds) of the test run.
| Type | Required |
| ---- | -------- |
| `number` | No
### `tests[].command[]`
[tests](#tests) > command

The command/entrypoint used to run the test inside the container.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
tests:
- command:
- /bin/sh
- '-c'
```
### `tests[].args[]`
[tests](#tests) > args

Expand Down Expand Up @@ -631,6 +696,22 @@ Maximum duration (in seconds) of the task's execution.
| Type | Required |
| ---- | -------- |
| `number` | No
### `tasks[].command[]`
[tasks](#tasks) > command

The command/entrypoint used to run the task inside the container.

| Type | Required |
| ---- | -------- |
| `array[string]` | No

Example:
```yaml
tasks:
- command:
- /bin/sh
- '-c'
```
### `tasks[].args[]`
[tasks](#tasks) > args

Expand Down Expand Up @@ -711,6 +792,7 @@ services:
- name:
dependencies: []
annotations: {}
command:
args:
daemon: false
ingresses:
Expand All @@ -726,6 +808,7 @@ services:
scheme: HTTP
command:
tcpPort:
hotReloadCommand:
hotReloadArgs:
limits:
cpu: 1000
Expand All @@ -745,13 +828,15 @@ tests:
- name:
dependencies: []
timeout: null
command:
args:
env: {}
tasks:
- name:
description:
dependencies: []
timeout: null
command:
args:
env: {}
jarPath:
Expand Down
Loading

0 comments on commit afbd953

Please sign in to comment.