Skip to content

Commit

Permalink
Update documentation #1358
Browse files Browse the repository at this point in the history
  • Loading branch information
ajain58 committed Jan 18, 2024
1 parent 1857ca3 commit e779bd7
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion docs/deep-dives/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,49 @@ steps:
With Docker Compose,
declare volume mounts in your [Compose file].
You won't need to declare the environment variables in the compose file anymore since `propagate-environment: true` will ensure the variables defined are propagated to the docker environment.
You won't need to declare the environment variables in the compose file since `propagate-environment: true` will ensure the variables defined are propagated to the docker environment.

For example, with the [Docker Buildkite plugin], we will need to add the `propagate-environment: true`:
```yaml
steps:
- commands:
- pnpm run lint
- pnpm run test
env:
# At SEEK, this instructs the build agent to populate the GITHUB_API_TOKEN environment variable for this step.
GET_GITHUB_TOKEN: 'please'
plugins:
- docker#v5.0.0:
# Enable GitHub integrations.
environment:
- GITHUB_API_TOKEN
propagate-environment: true
volumes:
# Mount cached dependencies.
- /workdir/node_modules
```

And then your [Compose file] will not need to define the `environment` like you had to before to ensure the environment variables are available in Docker

Docker compose file before:
```yaml
services:
app:
environment:
# Enable GitHub integrations.
- BUILDKITE
- BUILDKITE_BRANCH
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_PIPELINE_DEFAULT_BRANCH
- GITHUB_API_TOKEN
volumes:
- ./:/workdir
# Mount cached dependencies.
- /workdir/node_modules
```

Docker compose file after:
```yaml
services:
app:
Expand Down

0 comments on commit e779bd7

Please sign in to comment.