Last active
March 13, 2016 04:00
-
-
Save Bekt/7cb68b12674b282c8d78 to your computer and use it in GitHub Desktop.
Download the latest App Engine SDK
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
#!/usr/bin/env bash | |
# Blog post: http://bekt.github.io/p/gae-sdk/ | |
API_CHECK=https://appengine.google.com/api/updatecheck | |
SDK_VERSION=$(curl -s $API_CHECK | awk -F '\"' '/release/ {print $2}') | |
# Remove the dots. | |
SDK_VERSION_S=${SDK_VERSION//./} | |
SDK_URL=https://storage.googleapis.com/appengine-sdks/ | |
SDK_URL_A="${SDK_URL}featured/google_appengine_${SDK_VERSION}.zip" | |
SDK_URL_B="${SDK_URL}deprecated/$SDK_VERSION_S/google_appengine_${SDK_VERSION}.zip" | |
function download_sdk { | |
echo ">>> Downloading..." | |
curl -fo $HOME/gae.zip $SDK_URL_A || \ | |
curl -fo $HOME/gae.zip $SDK_URL_B || \ | |
exit 1 | |
unzip -qd $HOME $HOME/gae.zip | |
} | |
function upload { | |
echo ">>> Deploying..." | |
$HOME/google_appengine/appcfg.py \ | |
--oauth2 update my-app | |
} | |
download_sdk | |
upload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment