forked from cadence-workflow/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buildkite: generate docker image with tag master on every merge (cade…
- Loading branch information
1 parent
b6ac934
commit d14a6c8
Showing
3 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
# if current branch is not master, this PR is not merged to master yet | ||
if [ "$BUILDKITE_BRANCH" != "master" ]; then | ||
echo "Skipping docker-push since this change is not in master yet" | ||
exit 0 | ||
fi | ||
|
||
MASTER_SHA=$(git rev-parse origin/master) | ||
|
||
# if this commit is not the same as tip of master, lets skip this and | ||
# let the commit at tip of master do the push | ||
if [ "$BUILDKITE_COMMIT" != "$MASTER_SHA" ]; then | ||
echo "Skipping docker-push for this commit since tip of master is already ahead" | ||
exit 0 | ||
fi | ||
|
||
cd docker | ||
|
||
echo "Building docker image for $BUILDKITE_MESSAGE" | ||
|
||
docker build . -f Dockerfile -t ubercadence/server:master --build-arg git_branch=$BUILDKITE_COMMIT | ||
docker push ubercadence/server:master | ||
|
||
docker build . -f Dockerfile-cli -t ubercadence/cli:master --build-arg git_branch=$BUILDKITE_COMMIT | ||
docker push ubercadence/cli:master |