Skip to content

Commit 5edf992

Browse files
authored
Merge pull request #78 from buildkite-plugins/update-options
Clean up options and update the schema
2 parents 980bd75 + c19f674 commit 5edf992

File tree

2 files changed

+60
-56
lines changed

2 files changed

+60
-56
lines changed

README.md

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -90,75 +90,66 @@ steps:
9090

9191
## Configuration
9292

93+
### Required
94+
9395
### `image` (required, string)
9496

9597
The name of the Docker image to use.
9698

9799
Example: `node:7`
98100

99-
### `workdir`(optional, string)
100-
101-
The working directory to run the command in, inside the container. The default is `/workdir`.
102-
103-
Example: `/app`
101+
### Optional
104102

105-
### `mount-buildkite-agent` (optional, boolean)
103+
### `additional-groups` (optional, array)
106104

107-
Whether to automatically mount the `buildkite-agent` binary from the host agent machine into the container. Set to `false` if you want to disable, or if you already have your own binary in the image.
105+
Additional groups to be added to the user in the container, in an array of group names (or ids). See https://docs.docker.com/engine/reference/run/#additional-groups for more details.
108106

109-
Default: `true` for Linux, and `false` for macOS and Windows.
107+
Example: `docker`
110108

111-
### `volumes` (optional, array or boolean)
109+
### `always-pull` (optional, boolean)
112110

113-
Extra volume mounts to pass to the docker container, in an array. Items are specified as `SOURCE:TARGET`. Each entry corresponds to a Docker CLI `--volume` parameter. Relative local paths are converted to their full-path (e.g `.:/app`).
111+
Whether to always pull the latest image before running the command. Useful if the image has a `latest` tag.
114112

115-
To disable the default mount mounts, set `volumes` to `false`.
113+
Default: `false`
116114

117-
Default: `true`
118-
Example: `[ ".:/app", "/var/run/docker.sock:/var/run/docker.sock" ]`
115+
### `command` (optional, array)
119116

120-
### `always-pull` (optional, boolean)
117+
Sets the command for the Docker image, and defaults the `shell` option to `false`. Useful if the Docker image has an entrypoint, or doesn't contain a shell.
121118

122-
Whether to always pull the latest image before running the command. Useful if the image has a `latest` tag.
119+
This option can't be used if your step already has a top-level, non-plugin `command` option present.
123120

124-
Default: `false`
121+
Examples: `[ "/bin/mycommand", "-c", "test" ]`, `["arg1", "arg2"]`
125122

126-
### `environment` (optional, array)
123+
### `debug` (optional, boolean)
127124

128-
An array of additional environment variables to pass into to the docker container. Items can be specified as either `KEY` or `KEY=value`. Each entry corresponds to a Docker CLI `--env` parameter. Values specified as variable names will be passed through from the outer environment.
125+
Enables debug mode, which outputs the full Docker commands that will be run on the agent machine.
129126

130-
Example: `[ "BUILDKITE_MESSAGE", "MY_SECRET_KEY", "MY_SPECIAL_BUT_PUBLIC_VALUE=kittens" ]`
127+
Default: `false`
131128

132-
### `tty` (optional, boolean)
129+
### `entrypoint` (optional, string)
133130

134-
If set to false, doesn't allocate a TTY. This is useful in some situations where TTY's aren't supported, for instance windows.
131+
Override the image’s default entrypoint, and defaults the `shell` option to `false`. See the [docker run --entrypoint documentation](https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime) for more details.
135132

136-
Default: `true` for Linux and macOS, and `false` for Windows.
133+
Example: `/my/custom/entrypoint.sh`
137134

138-
### `user` (optional, string)
135+
### `environment` (optional, array)
139136

140-
Allows a user to be set, and override the USER entry in the Dockerfile. See https://docs.docker.com/engine/reference/run/#user for more details.
137+
An array of additional environment variables to pass into to the docker container. Items can be specified as either `KEY` or `KEY=value`. Each entry corresponds to a Docker CLI `--env` parameter. Values specified as variable names will be passed through from the outer environment.
141138

142-
Example: `root`
139+
Example: `[ "BUILDKITE_MESSAGE", "MY_SECRET_KEY", "MY_SPECIAL_BUT_PUBLIC_VALUE=kittens" ]`
143140

144-
### `additional-groups` (optional, array)
141+
### `mount-buildkite-agent` (optional, boolean)
145142

146-
Additional groups to be added to the user in the container, in an array of group names (or ids). See https://docs.docker.com/engine/reference/run/#additional-groups for more details.
143+
Whether to automatically mount the `buildkite-agent` binary from the host agent machine into the container. Set to `false` if you want to disable, or if you already have your own binary in the image.
147144

148-
Example: `docker`
145+
Default: `true` for Linux, and `false` for macOS and Windows.
149146

150147
### `network` (optional, string)
151148

152149
Join the container to the docker network specified. The network will be created if it does not already exist. See https://docs.docker.com/engine/reference/run/#network-settings for more details.
153150

154151
Example: `test-network`
155152

156-
### `debug` (optional, boolean)
157-
158-
Enables debug mode, which outputs the full Docker commands that will be run on the agent machine.
159-
160-
Default: `false`
161-
162153
### `runtime` (optional, string)
163154

164155
Specify an explicit docker runtime. See the [docker run options documentation](https://docs.docker.com/engine/reference/commandline/run/#options) for more details.
@@ -171,19 +162,32 @@ Set the shell to use for the command. Set it to `false` to pass the command dire
171162

172163
Example: `[ "powershell", "-Command" ]`
173164

174-
### `entrypoint` (optional, string)
165+
### `tty` (optional, boolean)
175166

176-
Override the image’s default entrypoint, and defaults the `shell` option to `false`. See the [docker run --entrypoint documentation](https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime) for more details.
167+
If set to false, doesn't allocate a TTY. This is useful in some situations where TTY's aren't supported, for instance windows.
177168

178-
Example: `/my/custom/entrypoint.sh`
169+
Default: `true` for Linux and macOS, and `false` for Windows.
179170

180-
### `command` (optional, array)
171+
### `user` (optional, string)
181172

182-
Sets the command for the Docker image, and defaults the `shell` option to `false`. Useful if the Docker image has an entrypoint, or doesn't contain a shell.
173+
Allows a user to be set, and override the USER entry in the Dockerfile. See https://docs.docker.com/engine/reference/run/#user for more details.
183174

184-
This option can't be used if your step already has a top-level, non-plugin `command` option present.
175+
Example: `root`
185176

186-
Examples: `[ "/bin/mycommand", "-c", "test" ]`, `["arg1", "arg2"]`
177+
### `volumes` (optional, array or boolean)
178+
179+
Extra volume mounts to pass to the docker container, in an array. Items are specified as `SOURCE:TARGET`. Each entry corresponds to a Docker CLI `--volume` parameter. Relative local paths are converted to their full-path (e.g `.:/app`).
180+
181+
To disable the default mount mounts, set `volumes` to `false`.
182+
183+
Default: `true`
184+
Example: `[ ".:/app", "/var/run/docker.sock:/var/run/docker.sock" ]`
185+
186+
### `workdir`(optional, string)
187+
188+
The working directory to run the command in, inside the container. The default is `/workdir`.
189+
190+
Example: `/app`
187191

188192
## License
189193

plugin.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@ requirements:
55
- docker
66
configuration:
77
properties:
8-
image:
9-
type: string
10-
workdir:
11-
type: string
8+
additional-groups:
9+
type: array
1210
always-pull:
13-
type: string
14-
mount-buildkite-agent:
1511
type: boolean
16-
mounts:
17-
type: [boolean,array]
18-
volumes:
19-
type: [boolean,array]
2012
command:
2113
type: array
14+
debug:
15+
type: boolean
2216
entrypoint:
2317
type: string
2418
environment:
2519
type: array
26-
user:
20+
image:
2721
type: string
28-
additional_groups:
29-
type: array
22+
mount-buildkite-agent:
23+
type: boolean
3024
network:
3125
type: string
32-
debug:
33-
type: boolean
3426
runtime:
3527
type: string
3628
shell:
3729
type: [boolean, array]
30+
tty:
31+
type: boolean
32+
user:
33+
type: string
34+
volumes:
35+
type: [boolean, array]
36+
workdir:
37+
type: string
3838
required:
3939
- image
4040
additionalProperties: false

0 commit comments

Comments
 (0)