diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..809ed32 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +sudo: false +language: python +python: + - "2.7" + +cache: + directories: + - $HOME/gcloud/ +env: + - PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json #Other environment variables on same line + +before_install: + #ENCRYPT YOUR PRIVATE KEY (If you need authentication) + # 1. Install and login to the Travis CLI: + # $ gem install travis + # $ travis login + # 2. Move your json private key to client_secrets.json + # 3. Run: + # $ travis encrypt-file client_secrets.json --add + # 4. Commit changes: + # $ git add client_secrets.json.enc + # $ git commit client_secrets.json.enc .travis.yml + + - if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then + mkdir -p $HOME/gcloud && + wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud && + cd $HOME/gcloud && + tar xzf google-cloud-sdk.tar.gz && + printf '\ny\n\ny\ny\n' | ./google-cloud-sdk/install.sh && + cd $TRAVIS_BUILD_DIR; + fi + - gcloud -q components update + - if [ -a client_secrets.json ]; then + gcloud auth activate-service-account --key-file client_secrets.json; + fi + +install: + #Add app specific setup here or additional gcloud components here + #Use -q to disable interaction + gcloud -q components update preview + +script: + #Test and/or deploy your app with gcloud commands here! + gcloud -q preview app run app.yaml diff --git a/README.md b/README.md index 0986ca6..70f8bae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ appengine-helloworld-python =========================== +[![Build Status](https://travis-ci.org/GoogleCloudPlatform/appengine-helloworld-python.svg)](https://travis-ci.org/GoogleCloudPlatform/appengine-helloworld-python) + This is a simple Hello World application for Google App Engine (Python) diff --git a/app.yaml b/app.yaml index e9606f9..e4f592e 100644 --- a/app.yaml +++ b/app.yaml @@ -1,5 +1,3 @@ -application: your-app-id -version: 1 runtime: python27 api_version: 1 threadsafe: yes