Created
January 29, 2019 19:18
-
-
Save ricardochaves/abb4ca742c8d2069c2b45f6fc1b73428 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| docker build -t gcr.io/${PROJECT_DEV}/${IMAGE_NAME}:$TRAVIS_COMMIT . | |
| echo $GCLOUD_SERVICE_KEY_DEV | base64 --decode -i > ${HOME}/gcloud-service-key.json | |
| gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json | |
| gcloud --quiet config set project $PROJECT_DEV | |
| gcloud --quiet config set container/cluster $CLUSTER_DEV | |
| gcloud --quiet config set compute/zone ${ZONE} | |
| gcloud --quiet container clusters get-credentials $CLUSTER_DEV | |
| gcloud docker -- push gcr.io/${PROJECT_DEV}/${IMAGE_NAME} | |
| yes | gcloud beta container images add-tag gcr.io/${PROJECT_DEV}/${IMAGE_NAME}:$TRAVIS_COMMIT gcr.io/${PROJECT_DEV}/${IMAGE_NAME}:latest | |
| kubectl -n ${K8S_NAMESPACE} set image deployment/${APP_DEPLOYMENT} ${APP_CONTAINER}=gcr.io/${PROJECT_DEV}/${IMAGE_NAME}:$TRAVIS_COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment