Skip to content

Instantly share code, notes, and snippets.

@Bekt Bekt/deploy.bash
Last active Mar 13, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.