File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ configuration:
76
76
type : integer
77
77
rm :
78
78
type : boolean
79
+ service-ports :
80
+ type : boolean
79
81
skip-checkout :
80
82
type : boolean
81
83
skip-pull :
Original file line number Diff line number Diff line change @@ -1257,6 +1257,33 @@ export BUILDKITE_JOB_ID=1111
1257
1257
assert_output --partial " built myservice"
1258
1258
assert_output --partial " ran myservice"
1259
1259
1260
+ unstub docker
1261
+ unstub buildkite-agent
1262
+ }
1263
+
1264
+ @test " Run with --service-ports" {
1265
+ export BUILDKITE_JOB_ID=1111
1266
+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
1267
+ export BUILDKITE_PIPELINE_SLUG=test
1268
+ export BUILDKITE_BUILD_NUMBER=1
1269
+ export BUILDKITE_COMMAND=pwd
1270
+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CHECK_LINKED_CONTAINERS=false
1271
+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLEANUP=false
1272
+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SERVICE_PORTS=true
1273
+
1274
+ stub docker \
1275
+ " compose -f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml pull myservice : echo pulled myservice" \
1276
+ " compose -f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml up -d --scale myservice=0 myservice : echo started dependencies for myservice" \
1277
+ " compose -f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml run --name buildkite1111_myservice_build_1 --rm --service-ports myservice /bin/sh -e -c $'pwd' : echo ran myservice without tty"
1278
+
1279
+ stub buildkite-agent \
1280
+ " meta-data exists docker-compose-plugin-built-image-tag-myservice : echo myimage" \
1281
+ " meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage"
1282
+
1283
+ run " $PWD " /hooks/command
1284
+
1285
+ assert_success
1286
+ assert_output --partial " ran myservice without tty"
1260
1287
unstub docker
1261
1288
unstub buildkite-agent
1262
1289
}
You can’t perform that action at this time.
0 commit comments