Created
November 28, 2016 14:25
-
-
Save afoninsky/b4b2c8bcc835a3f90885ec83ae65ee58 to your computer and use it in GitHub Desktop.
GKE deploy image
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 | |
### run deployment from local machine (not CI) | |
docker info | |
if [ "$?" -ne "0" ]; then | |
exit | |
fi | |
REGISTRY_URL="us.gcr.io" | |
GOOGLE_PROJECT_NAME="spair-api" | |
NAME=`node -e "console.log(require('./package').name)"` | |
VERSION=${1:-v`node -e "console.log(require('./package').version)"`} | |
IMAGE_TAG=$REGISTRY_URL/$GOOGLE_PROJECT_NAME/$NAME:$VERSION | |
# perform quick tests | |
# yarn test | |
# build image and push it to google | |
echo "Building image $IMAGE_TAG" | |
docker build -t $IMAGE_TAG . | |
echo "Pushing image to remote registry" | |
gcloud docker push $IMAGE_TAG | |
# docker rmi $IMAGE_TAG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment