diff --git a/README.md b/README.md index b719a146..2217f8e3 100644 --- a/README.md +++ b/README.md @@ -404,7 +404,7 @@ Will cause the image to be pushed twice (once by the build step and another by t ### `pull` (optional, run only) -Pull down multiple pre-built images. By default only the service that is being run will be pulled down, but this allows multiple images to be specified to handle prebuilt dependent images. +Pull down multiple pre-built images. By default only the service that is being run will be pulled down, but this allows multiple images to be specified to handle prebuilt dependent images. Note that pulling will be skipped if the `skip-pull` option is activated. ### `config` (optional) @@ -458,7 +458,13 @@ Example: `[ "powershell", "-Command" ]` ### `skip-checkout` (optional, run only) -Whether to skip the repository checkout phase. This is useful for steps that use a pre-built image. This will fail if there is no pre-built image. +Whether to skip the repository checkout phase. This is useful for steps that use a pre-built image and will fail if there is no pre-built image. + +**Important**: as the code repository will not be available in the step, you need to ensure that the docker compose file(s) are present in some way (like using artifacts) + +### `skip-pull` (optional, run only) + +Completely avoid running any `pull` command. Images being used will need to be present in the machine from before or have been built in the same step. Could be useful to avoid hitting rate limits when you can be sure the operation is unnecessary. Note that it is possible other commands run in the plugin's lifecycle will trigger a pull of necessary images. ### `workdir` (optional, run only) diff --git a/commands/run.sh b/commands/run.sh index 770afbb3..b78f01a1 100755 --- a/commands/run.sh +++ b/commands/run.sh @@ -69,7 +69,7 @@ elif [[ ${#pull_services[@]} -eq 1 ]] ; then fi # Pull down specified services -if [[ ${#pull_services[@]} -gt 0 ]] ; then +if [[ ${#pull_services[@]} -gt 0 ]] && [[ "$(plugin_read_config SKIP_PULL "false")" != "true" ]]; then echo "~~~ :docker: Pulling services ${pull_services[0]}" retry "$pull_retries" run_docker_compose "${pull_params[@]}" fi diff --git a/plugin.yml b/plugin.yml index c07eb7d9..788256e8 100644 --- a/plugin.yml +++ b/plugin.yml @@ -70,6 +70,8 @@ configuration: type: string rm: type: boolean + skip-pull: + type: boolean upload-container-logs: type: string propagate-uid-gid: @@ -96,21 +98,22 @@ configuration: - push additionalProperties: false dependencies: - pull: [ run ] - image-repository: [ build ] - image-name: [ build ] + ansi: [ run ] + cache-from: [ build ] + dependencies: [ run ] env: [ run ] environment: [ run ] - push-retries: [ push ] - cache-from: [ build ] - volumes: [ run ] expand-volume-vars: [ volumes ] + image-repository: [ build ] + image-name: [ build ] leave-volumes: [ run ] - use-aliases: [ run ] - dependencies: [ run ] - ansi: [ run ] + mount-buildkite-agent: [ run ] + propagate-uid-gid: [ run ] + pull: [ run ] + push-retries: [ push ] + skip-pull: [ run ] tty: [ run ] - workdir: [ run ] + use-aliases: [ run ] user: [ run ] - propagate-uid-gid: [ run ] - mount-buildkite-agent: [ run ] + volumes: [ run ] + workdir: [ run ] diff --git a/tests/build.bats b/tests/build.bats index aa89415b..77e4efe5 100644 --- a/tests/build.bats +++ b/tests/build.bats @@ -16,7 +16,7 @@ load '../lib/shared' stub docker-compose \ "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull myservice : echo built myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command unstub docker-compose assert_success @@ -33,7 +33,7 @@ load '../lib/shared' stub docker-compose \ "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull --no-cache myservice : echo built myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -50,7 +50,7 @@ load '../lib/shared' stub docker-compose \ "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull --parallel myservice : echo built myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -68,7 +68,7 @@ load '../lib/shared' stub docker-compose \ "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull --build-arg MYARG=0 --build-arg MYARG=1 myservice : echo built myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -85,7 +85,7 @@ load '../lib/shared' stub docker-compose \ "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull myservice : echo built myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -106,7 +106,7 @@ load '../lib/shared' stub buildkite-agent \ "meta-data set docker-compose-plugin-built-image-tag-myservice my.repository/llamas:test-myservice-build-1 : echo set image metadata for myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -134,7 +134,7 @@ load '../lib/shared' "meta-data set docker-compose-plugin-built-image-tag-myservice-1 my.repository/llamas:test-myservice-build-1 : echo set image metadata for myservice-1" \ "meta-data set docker-compose-plugin-built-image-tag-myservice-2 my.repository/llamas:test-myservice-build-1 : echo set image metadata for myservice-2" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -163,7 +163,7 @@ load '../lib/shared' stub buildkite-agent \ "meta-data set docker-compose-plugin-built-image-tag-myservice my.repository/llamas:test-myservice-build-1 : echo set image metadata for myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -188,7 +188,7 @@ load '../lib/shared' stub buildkite-agent \ "meta-data set docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml my.repository/llamas:test-myservice-build-1 : echo set image metadata for myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -214,7 +214,7 @@ load '../lib/shared' stub buildkite-agent \ "meta-data set docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml-tests/composefiles/docker-compose.v2.1.yml my.repository/llamas:test-myservice-build-1 : echo set image metadata for myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -240,7 +240,7 @@ load '../lib/shared' "meta-data set docker-compose-plugin-built-image-tag-myservice1 my.repository/llamas:test-myservice1-build-1 : echo set image metadata for myservice1" \ "meta-data set docker-compose-plugin-built-image-tag-myservice2 my.repository/llamas:test-myservice2-build-1 : echo set image metadata for myservice2" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built all services" @@ -258,7 +258,7 @@ load '../lib/shared' export BUILDKITE_PIPELINE_SLUG=test export BUILDKITE_BUILD_NUMBER=1 - run $PWD/hooks/command + run "$PWD"/hooks/command assert_failure assert_output --partial "Compose file versions 2.0 and above" @@ -278,7 +278,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image" @@ -300,7 +300,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull --no-cache helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success refute_output --partial "pulled cache image" @@ -324,7 +324,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image" @@ -355,7 +355,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image build-target" @@ -392,7 +392,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image build-target-latest" @@ -431,7 +431,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image build-target-latest" @@ -463,7 +463,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image" @@ -488,7 +488,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "my.repository/myservice_cache:latest will not be used as a cache for helloworld" @@ -512,7 +512,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull hello-world : echo built hello-world" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image" @@ -564,7 +564,7 @@ load '../lib/shared' stub docker-compose \ "-f tests/composefiles/docker-compose.v3.2.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml build --pull helloworld : echo built helloworld" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled cache image" @@ -589,7 +589,7 @@ load '../lib/shared' stub buildkite-agent \ "meta-data set docker-compose-plugin-built-image-tag-myservice my.repository/llamas:my-llamas-image : echo set image metadata for myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -615,7 +615,7 @@ load '../lib/shared' stub buildkite-agent \ "meta-data set docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v3.2.yml my.repository/llamas:my-llamas-image : echo set image metadata for myservice" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -643,7 +643,7 @@ load '../lib/shared' "meta-data set docker-compose-plugin-built-image-tag-myservice1 my.repository/llamas:my-llamas-image-1 : echo set image metadata for myservice1" \ "meta-data set docker-compose-plugin-built-image-tag-myservice2 my.repository/llamas:my-llamas-image-2 : echo set image metadata for myservice2" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built all services" diff --git a/tests/run.bats b/tests/run.bats index c526a020..2b4ef823 100644 --- a/tests/run.bats +++ b/tests/run.bats @@ -25,7 +25,7 @@ load '../lib/run' stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -51,7 +51,7 @@ load '../lib/run' stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success refute_output --partial "The Docker Compose Plugin does not correctly support step-level array commands" @@ -79,7 +79,7 @@ load '../lib/run' stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -105,7 +105,7 @@ load '../lib/run' stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -133,7 +133,7 @@ cmd3" stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "The Docker Compose Plugin does not correctly support step-level array commands" @@ -162,7 +162,7 @@ cmd3" stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success refute_output --partial "The Docker Compose Plugin does not correctly support step-level array commands" @@ -194,7 +194,7 @@ cmd3" stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice" @@ -220,7 +220,7 @@ cmd3" stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -248,7 +248,7 @@ cmd3" stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -335,7 +335,7 @@ cmd3" "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice" @@ -362,7 +362,7 @@ cmd3" "meta-data exists docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice" @@ -390,7 +390,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml-tests/composefiles/docker-compose.v2.1.yml : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml-tests/composefiles/docker-compose.v2.1.yml : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice" @@ -417,7 +417,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice-tests/composefiles/docker-compose.v2.0.yml : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice" @@ -441,7 +441,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_failure assert_output --partial "Exited with 2" @@ -469,7 +469,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled myservice" @@ -497,7 +497,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice without tty" @@ -523,7 +523,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice without dependencies" @@ -550,7 +550,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice without ansi output" @@ -558,6 +558,33 @@ export BUILDKITE_JOB_ID=1111 unstub buildkite-agent } + +@test "Run without pull" { + export BUILDKITE_JOB_ID=1111 + export BUILDKITE_PIPELINE_SLUG=test + export BUILDKITE_BUILD_NUMBER=1 + export BUILDKITE_COMMAND=pwd + export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice + export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SKIP_PULL=true + + stub docker-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" \ + "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml run --name buildkite1111_myservice_build_1 --rm myservice /bin/sh -e -c 'pwd' : echo ran myservice without pull" + + stub buildkite-agent \ + "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ + "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" + + run "$PWD"/hooks/command + + assert_success + assert_output --partial "Running /bin/sh -e -c 'pwd' in service myservice" + assert_output --partial "ran myservice without pull" + + unstub docker-compose + unstub buildkite-agent +} + @test "Run with use aliases" { export BUILDKITE_JOB_ID=1111 export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice @@ -577,7 +604,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with use aliases output" @@ -605,7 +632,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -632,7 +659,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -662,7 +689,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -695,7 +722,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -731,7 +758,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -766,7 +793,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -793,7 +820,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice with volumes" @@ -821,7 +848,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice-llamas1.yml-llamas2.yml-llamas3.yml : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -847,7 +874,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_failure assert_output --partial "^^^ +++" @@ -878,7 +905,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice2 : exit 0" \ "meta-data get docker-compose-plugin-built-image-tag-myservice2 : echo myimage2" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "pulled myservice1 and myservice2" @@ -905,7 +932,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -932,7 +959,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -955,7 +982,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_failure assert_output --partial "Error" @@ -983,7 +1010,7 @@ export BUILDKITE_JOB_ID=1111 "meta-data exists docker-compose-plugin-built-image-tag-myservice : echo myimage" \ "meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "ran myservice without tty" @@ -1001,8 +1028,6 @@ export BUILDKITE_JOB_ID=1111 export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLEANUP=false export BUILDKITE_PLUGIN_DOCKER_COMPOSE_ENTRYPOINT="my custom entrypoint" - ENTRYPOINT='--entrypoint\ \"my\ custom\ entrypoint\"' - stub docker-compose \ "-f docker-compose.yml -p buildkite1111 build --pull myservice : echo built myservice" \ "-f docker-compose.yml -p buildkite1111 up -d --scale myservice=0 : echo ran myservice dependencies" \ @@ -1011,7 +1036,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -1038,7 +1063,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -1066,7 +1091,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -1093,7 +1118,7 @@ export BUILDKITE_JOB_ID=1111 stub buildkite-agent \ "meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1" - run $PWD/hooks/command + run "$PWD"/hooks/command assert_success assert_output --partial "built myservice" @@ -1124,7 +1149,7 @@ export BUILDKITE_JOB_ID=1111 apk add netcat-openbsd nc -lkvU $SSH_AUTH_SOCK & - run $PWD/hooks/command + run "$PWD"/hooks/command kill %1