From aefb613e7222f554d17b6c6a741ec79fbe620c8f Mon Sep 17 00:00:00 2001 From: Zack Kirsch Date: Fri, 26 Aug 2022 17:54:00 -0700 Subject: [PATCH] Run docker build on commits, to prevent docker build from breaking in the future --- .buildkite/pipeline-pull-request.yml | 9 +++++++++ scripts/buildkite/docker-build.sh | 11 +++++++++++ scripts/buildkite/docker-push.sh | 12 ++---------- 3 files changed, 22 insertions(+), 10 deletions(-) create mode 100755 scripts/buildkite/docker-build.sh diff --git a/.buildkite/pipeline-pull-request.yml b/.buildkite/pipeline-pull-request.yml index 4728f20392b..f4a36f596a4 100644 --- a/.buildkite/pipeline-pull-request.yml +++ b/.buildkite/pipeline-pull-request.yml @@ -152,3 +152,12 @@ steps: - docker-compose#v3.0.0: run: coverage-report config: docker/buildkite/docker-compose.yml + + - label: ":docker: build (no push)" + agents: + queue: "workers" + docker: "*" + command: "scripts/buildkite/docker-build.sh" + retry: + automatic: + limit: 1 diff --git a/scripts/buildkite/docker-build.sh b/scripts/buildkite/docker-build.sh new file mode 100755 index 00000000000..c1d0685bffc --- /dev/null +++ b/scripts/buildkite/docker-build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -ex + +echo "Building docker images for $BUILDKITE_MESSAGE" + +docker build . -f Dockerfile -t ubercadence/server:master --build-arg TARGET=server +docker build . -f Dockerfile -t ubercadence/server:master-auto-setup --build-arg TARGET=auto-setup +docker build . -f Dockerfile -t ubercadence/cli:master --build-arg TARGET=cli +docker build . -f Dockerfile -t ubercadence/cadence-bench:master --build-arg TARGET=bench +docker build . -f Dockerfile -t ubercadence/cadence-canary:master --build-arg TARGET=canary diff --git a/scripts/buildkite/docker-push.sh b/scripts/buildkite/docker-push.sh index edc73924c1d..63f3e88aaf9 100755 --- a/scripts/buildkite/docker-push.sh +++ b/scripts/buildkite/docker-push.sh @@ -18,19 +18,11 @@ if [ "$BUILDKITE_COMMIT" != "$MASTER_SHA" ]; then exit 0 fi -echo "Building docker image for $BUILDKITE_MESSAGE" +scripts/buildkite/docker-build.sh -docker build . -f Dockerfile -t ubercadence/server:master --build-arg TARGET=server +echo "Pushing docker images for $BUILDKITE_MESSAGE" docker push ubercadence/server:master - -docker build . -f Dockerfile -t ubercadence/server:master-auto-setup --build-arg TARGET=auto-setup docker push ubercadence/server:master-auto-setup - -docker build . -f Dockerfile -t ubercadence/cli:master --build-arg TARGET=cli docker push ubercadence/cli:master - -docker build . -f Dockerfile -t ubercadence/cadence-bench:master --build-arg TARGET=bench docker push ubercadence/cadence-bench:master - -docker build . -f Dockerfile -t ubercadence/cadence-canary:master --build-arg TARGET=canary docker push ubercadence/cadence-canary:master