Skip to content

Instantly share code, notes, and snippets.

@Bekt
Last active March 13, 2016 04:00
Show Gist options
  • Select an option

  • Save Bekt/7cb68b12674b282c8d78 to your computer and use it in GitHub Desktop.

Select an option

Save Bekt/7cb68b12674b282c8d78 to your computer and use it in GitHub Desktop.

Revisions

  1. Bekt revised this gist May 21, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deploy.bash
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/usr/bin/env bash

    # Blog post: http://bekt.github.io/p/gae-ssl/
    # 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}')
  2. Bekt created this gist May 20, 2015.
    29 changes: 29 additions & 0 deletions deploy.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    #!/usr/bin/env bash

    # Blog post: http://bekt.github.io/p/gae-ssl/

    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