Last active
January 30, 2019 07:24
-
-
Save sideshowbandana/73fc8590b872971f241b932d6e06f4df to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
PROJECT_ID=[GCLOUD_PROJECT_ID] | |
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://gcr.io | |
docker build ${DOCKER_BUILD_ARGS} -t ${IMAGE} . | |
set -x | |
docker tag ${IMAGE} gcr.io/${PROJECT_ID}/${IMAGE}:${CIRCLE_SHA1} | |
docker push gcr.io/${PROJECT_ID}/${IMAGE}:${CIRCLE_SHA1} | |
if [ "$CIRCLE_BRANCH" = "master" ] | |
then | |
docker tag ${IMAGE} gcr.io/${PROJECT_ID}/${IMAGE}:latest | |
docker push gcr.io/${PROJECT_ID}/${IMAGE}:latest | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment