Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
image: python:2.7
image: atlassian/default-image:2

pipelines:
default:
- step:
script:
# Install Google Cloud SDK
- export CLOUDSDK_CORE_DISABLE_PROMPTS=1
# Google Cloud SDK is pinned for build reliability. Bump if the SDK complains about deprecation.
- SDK_VERSION=127.0.0
- SDK_FILENAME=google-cloud-sdk-${SDK_VERSION}-linux-x86_64.tar.gz
- curl -O -J https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${SDK_FILENAME}
- tar -zxvf ${SDK_FILENAME} --directory ${HOME}
- export PATH=${PATH}:${HOME}/google-cloud-sdk/bin
# Install Google App Engine SDK
- GAE_PYTHONPATH=${HOME}/google_appengine
- export PYTHONPATH=${PYTHONPATH}:${GAE_PYTHONPATH}
- python scripts/fetch_gae_sdk.py $(dirname "${GAE_PYTHONPATH}")
- echo "${PYTHONPATH}" && ls ${GAE_PYTHONPATH}
# Install app & dev dependencies, test, deploy, test deployment
- pip --quiet install -r requirements.txt -t lib/
- echo "key = '${GOOGLE_API_KEY}'" > api_key.py
- python test_main.py
- echo ${GOOGLE_CLIENT_SECRET} > client-secret.json
- gcloud auth activate-service-account --key-file client-secret.json
- gcloud --quiet --verbosity=error app deploy app.yaml --promote
- python e2e_test.py
- step:
name: build
image: python:2.7
script:
- pip --quiet install -r requirements.txt -t lib/
- echo "key = '${GOOGLE_API_KEY}'" > api_key.py
- python test_main.py
artifacts:
- lib/**
- api_key.py
- step:
name: deploy
image: google/cloud-sdk
deployment: production
script:
- echo "$GOOGLE_CLIENT_SECRET" > /tmp/gae_key.json
- gcloud config set project $GAE_PROJECT
- gcloud auth activate-service-account --key-file /tmp/gae_key.json
- gcloud --quiet --verbosity=error app deploy app.yaml --promote
- rm /tmp/gae_key.json
- step:
name: test
image: python:2.7
script:
- python e2e_test.py