Skip to content

Commit dd36b64

Browse files
authored
Merge pull request #488 from buildkite-plugins/toote_minor_changes
Minor changes
2 parents e88d05b + 652a6d7 commit dd36b64

3 files changed

Lines changed: 38 additions & 28 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ You can learn a lot about how this plugin is used by browsing the [documentation
1313

1414
## Configuration
1515

16+
Important: this plugin assumes that your docker compose file is called `docker-compose.yml`. If your file is called diferently, make sure to set plugin's `config` option or - more generally - set the pipeline-level environment variable `COMPOSE_FILE` with the right value. This is due to the possible usage of a custom-named override files in some situations and can not be worked around due to limitations of docker's `-f` option.
17+
1618
### Main Commands
1719

1820
You will need to specify at least one of the following to use this extension.

docs/examples.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following pipeline will run `test.sh` inside a `app` service container using
1010
steps:
1111
- command: test.sh
1212
plugins:
13-
- docker-compose#v5.8.0:
13+
- docker-compose#v5.9.0:
1414
run: app
1515
```
1616
@@ -19,7 +19,7 @@ steps:
1919
```yml
2020
steps:
2121
- plugins:
22-
- docker-compose#v5.8.0:
22+
- docker-compose#v5.9.0:
2323
run: app
2424
command: ["custom", "command", "values"]
2525
```
@@ -31,7 +31,7 @@ The plugin will honor the value of the `COMPOSE_FILE` environment variable if on
3131
steps:
3232
- command: test.sh
3333
plugins:
34-
- docker-compose#v5.8.0:
34+
- docker-compose#v5.9.0:
3535
run: app
3636
config: docker-compose.tests.yml
3737
env:
@@ -47,15 +47,15 @@ steps:
4747
- plugins:
4848
- docker-login#v2.0.1:
4949
username: xyz
50-
- docker-compose#v5.8.0:
50+
- docker-compose#v5.9.0:
5151
build: app
5252
push: app:index.docker.io/myorg/myrepo:tag
5353
- wait
5454
- command: test.sh
5555
plugins:
5656
- docker-login#v2.0.1:
5757
username: xyz
58-
- docker-compose#v5.8.0:
58+
- docker-compose#v5.9.0:
5959
run: app
6060
```
6161

@@ -72,7 +72,7 @@ steps:
7272
- command: generate-dist.sh
7373
artifact_paths: "dist/*"
7474
plugins:
75-
- docker-compose#v5.8.0:
75+
- docker-compose#v5.9.0:
7676
run: app
7777
volumes:
7878
- "./dist:/folder/dist"
@@ -96,7 +96,7 @@ this plugin offers a `environment` block of its own:
9696
steps:
9797
- command: generate-dist.sh
9898
plugins:
99-
- docker-compose#v5.8.0:
99+
- docker-compose#v5.9.0:
100100
run: app
101101
env:
102102
- BUILDKITE_BUILD_NUMBER
@@ -114,7 +114,7 @@ Alternatively, you can have the plugin add all environment variables defined for
114114
steps:
115115
- command: use-vars.sh
116116
plugins:
117-
- docker-compose#v5.8.0:
117+
- docker-compose#v5.9.0:
118118
run: app
119119
propagate-environment: true
120120
```
@@ -130,7 +130,7 @@ steps:
130130
env:
131131
COMPOSE_PROFILES: "frontend,debug"
132132
plugins:
133-
- docker-compose#v5.8.0:
133+
- docker-compose#v5.9.0:
134134
run: app
135135
```
136136

@@ -167,7 +167,7 @@ Alternatively, if you want to set build arguments when pre-building an image, th
167167
steps:
168168
- command: generate-dist.sh
169169
plugins:
170-
- docker-compose#v5.8.0:
170+
- docker-compose#v5.9.0:
171171
build: app
172172
args:
173173
- MY_CUSTOM_ARG=panda
@@ -184,7 +184,7 @@ If you have multiple steps that use the same service/image (such as steps that r
184184
steps:
185185
- label: ":docker: Build"
186186
plugins:
187-
- docker-compose#v5.8.0:
187+
- docker-compose#v5.9.0:
188188
build: app
189189
push: app
190190
@@ -194,7 +194,7 @@ steps:
194194
command: test.sh
195195
parallelism: 25
196196
plugins:
197-
- docker-compose#v5.8.0:
197+
- docker-compose#v5.9.0:
198198
run: app
199199
require-prebuild: true
200200
```
@@ -213,7 +213,7 @@ steps:
213213
agents:
214214
queue: docker-builder
215215
plugins:
216-
- docker-compose#v5.8.0:
216+
- docker-compose#v5.9.0:
217217
build:
218218
- app
219219
- tests
@@ -227,7 +227,7 @@ steps:
227227
command: test.sh
228228
parallelism: 25
229229
plugins:
230-
- docker-compose#v5.8.0:
230+
- docker-compose#v5.9.0:
231231
run: tests
232232
```
233233

@@ -239,7 +239,7 @@ If you want to push your Docker images ready for deployment, you can use the `pu
239239
steps:
240240
- label: ":docker: Push"
241241
plugins:
242-
- docker-compose#v5.8.0:
242+
- docker-compose#v5.9.0:
243243
push: app
244244
```
245245

@@ -249,7 +249,7 @@ To push multiple images, you can use a list:
249249
steps:
250250
- label: ":docker: Push"
251251
plugins:
252-
- docker-compose#v5.8.0:
252+
- docker-compose#v5.9.0:
253253
push:
254254
- first-service
255255
- second-service
@@ -261,7 +261,7 @@ If you want to push to a specific location (that's not defined as the `image` in
261261
steps:
262262
- label: ":docker: Push"
263263
plugins:
264-
- docker-compose#v5.8.0:
264+
- docker-compose#v5.9.0:
265265
push:
266266
- app:index.docker.io/myorg/myrepo/myapp
267267
- app:index.docker.io/myorg/myrepo/myapp:latest
@@ -275,7 +275,7 @@ A newly spawned agent won't contain any of the docker caches for the first run w
275275
steps:
276276
- label: ":docker: Build an image"
277277
plugins:
278-
- docker-compose#v5.8.0:
278+
- docker-compose#v5.9.0:
279279
build: app
280280
push: app:index.docker.io/myorg/myrepo:my-branch
281281
cache-from:
@@ -286,7 +286,7 @@ steps:
286286
287287
- label: ":docker: Push to final repository"
288288
plugins:
289-
- docker-compose#v5.8.0:
289+
- docker-compose#v5.9.0:
290290
push:
291291
- app:myregistry:port/myrepo/myapp:latest
292292
```
@@ -299,7 +299,7 @@ The values you add in the `cache-from` will be mapped to the corresponding servi
299299
steps:
300300
- label: ":docker: Build an image"
301301
plugins:
302-
- docker-compose#v5.8.0:
302+
- docker-compose#v5.9.0:
303303
build: app
304304
push: app:index.docker.io/myorg/myrepo:my-branch
305305
cache-from:
@@ -310,7 +310,7 @@ steps:
310310
311311
- label: ":docker: Push to final repository"
312312
plugins:
313-
- docker-compose#v5.8.0:
313+
- docker-compose#v5.9.0:
314314
push:
315315
- app:myregistry:port/myrepo/myapp:latest
316316
```
@@ -327,7 +327,7 @@ The `docker` driver can handle most situations but for advance features with the
327327
steps:
328328
- label: ":docker: Build an image"
329329
plugins:
330-
- docker-compose#v5.8.0:
330+
- docker-compose#v5.9.0:
331331
build: app
332332
push: app:index.docker.io/myorg/myrepo:my-branch
333333
cache-from:
@@ -349,7 +349,7 @@ By default, Builder Instances specified by `name` or that are created with `crea
349349
steps:
350350
- label: ":docker: Build an image"
351351
plugins:
352-
- docker-compose#v5.8.0:
352+
- docker-compose#v5.9.0:
353353
build: app
354354
push: app:index.docker.io/myorg/myrepo:my-branch
355355
cache-from:
@@ -368,7 +368,7 @@ By default, Builder Instances specified by `name` or that are created with `crea
368368
steps:
369369
- label: ":docker: Build an image"
370370
plugins:
371-
- docker-compose#v5.8.0:
371+
- docker-compose#v5.9.0:
372372
build: app
373373
push: app:index.docker.io/myorg/myrepo:my-branch
374374
cache-from:
@@ -394,7 +394,7 @@ A newly spawned agent won't contain any of the docker caches for the first run w
394394
steps:
395395
- label: ":docker: Build an image and push cache"
396396
plugins:
397-
- docker-compose#v5.8.0:
397+
- docker-compose#v5.9.0:
398398
build: app
399399
push: app:${DOCKER_REGISTRY}/${IMAGE_REPO}:cache
400400
cache-from:
@@ -406,12 +406,12 @@ steps:
406406
use: true
407407
create: true
408408
driver: docker-container
409-
409+
410410
- wait
411411
412412
- label: ":docker: Build an image using remote cache"
413413
plugins:
414-
- docker-compose#v5.8.0:
414+
- docker-compose#v5.9.0:
415415
build: app
416416
cache-from:
417417
- "app:type=registry,ref=${DOCKER_REGISTRY}/${IMAGE_REPO}:cache"

lib/shared.bash

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,17 @@ function docker_compose_config_files() {
121121
return
122122
fi
123123

124+
# If COMPOSE_PATH_SEPARATOR is not set, use the default separator
125+
if is_windows ; then
126+
DEFAULT_SEPARATOR=";"
127+
else
128+
DEFAULT_SEPARATOR=":"
129+
fi
130+
SEPARATOR="${COMPOSE_PATH_SEPARATOR:-$DEFAULT_SEPARATOR}"
131+
124132
# Process any (deprecated) colon delimited config paths
125133
for value in "${config_files[@]}" ; do
126-
echo "$value" | tr ':' '\n'
134+
echo "$value" | tr "${SEPARATOR}" '\n'
127135
done
128136
}
129137

0 commit comments

Comments
 (0)