Created
January 19, 2018 22:01
-
-
Save mathcass/cc9fdd666c2631f10ca63aab0f3bd200 to your computer and use it in GitHub Desktop.
A generic AppEngine deploy script
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 | |
# Deploys application to default service setting version to current time, thus | |
# mimicking how `gcloud app deploy` works | |
APP="$PROJECT_NAME" # Or, just replace with your project | |
VERSION=$(date +%Y%m%dt%H%M%S) # ${year}${month}${day}t${24hour}${minute}${second} | |
gcloud config set project "$APP" | |
echo "Deploying $APP to version $VERSION..." | |
goapp deploy -application "$APP" -version "$VERSION" | |
if [ $? -eq 0 ]; then | |
echo "Setting traffic for $APP running $VERSION to 100%" | |
gcloud app services set-traffic default --splits "$VERSION=1" | |
else | |
echo "Encountered an error deploying the application, aborting..." | |
fi | |
gcloud config unset project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment