Skip to content

Commit

Permalink
Merge pull request #99 from buildkite-plugins/update-docs-for-v3
Browse files Browse the repository at this point in the history
Update docs for v3
  • Loading branch information
lox authored Jan 30, 2019
2 parents 211bd27 + a01c16c commit 579f8eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ steps:
always-pull: true
```
If you want to control how your command is passed to the docker container, you can use the `command` parameter on the plugin directly, which also disables the default volume mounts:
If you want to control how your command is passed to the docker container, you can use the `command` parameter on the plugin directly:

```yml
steps:
Expand All @@ -37,7 +37,6 @@ steps:
image: "mesosphere/aws-cli"
always-pull: true
command: ["s3", "sync", "s3://my-bucket/dist/", "/app/dist"]
volumes: [ "./:/app" ]
artifact_paths: "dist/**"
```

Expand All @@ -52,9 +51,6 @@ steps:
- docker#v3.0.0:
image: "node:7"
always-pull: true
workdir: "/app"
volumes:
- "./code:/app"
environment:
- "MY_SECRET_KEY"
- "MY_SPECIAL_BUT_PUBLIC_VALUE=kittens"
Expand All @@ -73,13 +69,10 @@ steps:
- docker#v3.0.0:
image: "node:7"
always-pull: true
workdir: "/app"
volumes:
- "./code:/app"
propagate-environment: true
```

You can pass in additional volumes to be mounted. This disables the default mount behaviour of mounting `$PWD` to `/workdir`. This is useful for running Docker :
You can pass in additional volumes to be mounted. This is useful for running Docker:

```yml
steps:
Expand All @@ -91,11 +84,10 @@ steps:
image: "docker:latest"
always-pull: true
volumes:
- ".:/work"
- "/var/run/docker.sock:/var/run/docker.sock"
```

You can disable all mounts, including the default by setting `volumes` to `false`:
You can disable the default behaviour of mounting in the checkout to `workdir`:

```yml
steps:
Expand All @@ -104,7 +96,7 @@ steps:
- docker#v3.0.0:
image: "node:7"
always-pull: true
volumes: false
mount-checkout: false
```

## Configuration
Expand Down Expand Up @@ -231,12 +223,9 @@ Example: `root`

### `volumes` (optional, array or boolean)

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`).
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 `./code:/app`).

To disable the default mount mounts, set `volumes` to `false`.

Default: `true`
Example: `[ ".:/app", "/var/run/docker.sock:/var/run/docker.sock" ]`
Example: `[ "/var/run/docker.sock:/var/run/docker.sock" ]`

### `tmpfs` (optional, array)

Expand All @@ -246,7 +235,7 @@ Example: `[ "/tmp", "/root/.cache" ]`

### `workdir`(optional, string)

The working directory to run the command in, inside the container. The default is `/workdir`.
The working directory to run the command in, inside the container. The default is `/workdir`. This path is also used by `mount-checkout` to determine where to mount the checkout in the container.

Example: `/app`

Expand Down
6 changes: 5 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ configuration:
type: string
mount-buildkite-agent:
type: boolean
mount-ssh-agent:
type: boolean
mount-checkout:
type: boolean
network:
type: string
runtime:
Expand All @@ -34,7 +38,7 @@ configuration:
user:
type: string
volumes:
type: [boolean, array]
type: array
tmpfs:
type: array
workdir:
Expand Down

0 comments on commit 579f8eb

Please sign in to comment.