Skip to content

Commit

Permalink
ci: add buildkite
Browse files Browse the repository at this point in the history
  • Loading branch information
ei-grad committed Aug 23, 2019
1 parent f0034e8 commit 501f036
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ci/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ set -e
set -x

IMAGE=lizaalert/lacmus
TAG=travis-${TRAVIS_COMMIT:0:7}${TARGET#build}

if [[ -n "$TRAVIS" ]]; then
TAG=travis-${TRAVIS_COMMIT:0:7}${TARGET#build}
elif [[ -n "$BUILDKITE" ]]; then
TAG=bk-${BUILDKITE_COMMIT:0:7}${TARGET#build}
fi

docker login -u $SECRET_DOCKER_LOGIN -p $SECRET_DOCKER_PASSWORD
docker push $IMAGE:$TAG
Expand All @@ -19,9 +24,21 @@ if [ -n "$TRAVIS_TAG" ]; then
docker push $IMAGE:$TRAVIS_TAG${TARGET#build}
fi

if [[ -n "$BUILDKITE_TAG" ]]; then
docker tag $IMAGE:$TAG $IMAGE:${BUILDKITE_TAG}${TARGET#build}
docker push $IMAGE:$TRAVIS_TAG${TARGET#build}
fi

if [[ "$TRAVIS_PULL_REQUEST" == "false" && \
"$TRAVIS_REPO_SLUG" == "$IMAGE" && \
"$TRAVIS_BRANCH" == "master" ]]; then
docker tag $IMAGE:$TAG $IMAGE:latest${TARGET#build}
docker push $IMAGE:latest${TARGET#build}
fi

if [[ "$BUILDKITE_PULL_REQUEST" == "false" && \
"$BUILDKITE_REPO" == "[email protected]:$IMAGE.git" && \
"$BUILDKITE_BRANCH" == "master" ]]; then
docker tag $IMAGE:$TAG $IMAGE:latest${TARGET#build}
docker push $IMAGE:latest${TARGET#build}
fi

0 comments on commit 501f036

Please sign in to comment.