Skip to content

Instantly share code, notes, and snippets.

@ken5scal
Created November 23, 2016 17:27
Show Gist options
  • Save ken5scal/42c876ef485a73daeea74d35897eb20d to your computer and use it in GitHub Desktop.
Save ken5scal/42c876ef485a73daeea74d35897eb20d to your computer and use it in GitHub Desktop.
GKE Registryアップロードのshell script
#!/bin/bash
sudo /opt/google-cloud-sdk/bin/gcloud docker push asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:latest
if [[ "$CIRCLE_TAG" =~ v[0-9]+(\.[0-9]+)* ]]; then
docker tag asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:$CIRCLE_SHA1 asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:${CIRCLE_TAG}
sudo /opt/google-cloud-sdk/bin/gcloud docker push asia.gcr.io/${PROJECT_NAME}/${CONTAINER_NAME}:$CIRCLE_TAG
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment