diff --git a/hooks/pre-command b/hooks/pre-command index 09a6c97..0525656 100755 --- a/hooks/pre-command +++ b/hooks/pre-command @@ -32,10 +32,12 @@ if ! docker pull "${image_name}:${image_tag}"; then if [ "$BUILDKITE_BRANCH" == "$BUILDKITE_PIPELINE_DEFAULT_BRANCH" ]; then docker build . --file "${docker_file}" -t "${image_name}:${image_tag}" -t "${image_name}:latest" || exit 1 else - docker build . --file "${docker_file}" -t "${image_name}" || exit 1 + docker build . --file "${docker_file}" -t "${image_name}:${image_tag}" || exit 1 fi - docker push "${image_name}" fi || echo "Not found" + +docker tag "${image_name}" "branch-$BUILDKITE_BUILD_NUMBER" +docker push "${image_name}" # Support using https://github.com/buildkite-plugins/docker-buildkite-plugin without an image -export BUILDKITE_PLUGIN_DOCKER_IMAGE="${image_name}" +export BUILDKITE_PLUGIN_DOCKER_IMAGE="${image_name}" \ No newline at end of file