Skip to content

Instantly share code, notes, and snippets.

@Bekt
Last active March 13, 2016 04:00
Show Gist options
  • Save Bekt/7cb68b12674b282c8d78 to your computer and use it in GitHub Desktop.
Save Bekt/7cb68b12674b282c8d78 to your computer and use it in GitHub Desktop.
Download the latest App Engine SDK
#!/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