-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathcircle.yml
48 lines (43 loc) · 1.9 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
# law or agreed to in writing, software distributed under the License is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and
# limitations under the License.
machine:
environment:
# Add app engine sdk to pythonpath for local unit tests.
PYTHONPATH: ${PYTHONPATH}:${HOME}/google_appengine
# Replace this with your project ID
GCLOUD_PROJECT: "$GCLOUD_PROJECT_ID"
dependencies:
pre:
# Download App Engine SDK
# This is not necessary to deploy, its only necessary to run local tests importing the App Engine SDK
- curl -o $HOME/google_appengine_1.9.30.zip https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.30.zip
- unzip -q -d $HOME $HOME/google_appengine_1.9.30.zip
# Retrieve our secrets from the CircleCI environment
- echo $CLIENT_SECRET | base64 --decode > ${HOME}/client-secret.json
# vendor our dependencies
- mkdir -p lib
- pip install -r requirements.txt -t lib
# Make sure gcloud is up to date
- gcloud --quiet components update app
# authenticate gcloud
- gcloud auth activate-service-account --key-file ${HOME}/client-secret.json
# Replace <your-project-id>
- gcloud config set project $GCLOUD_PROJECT_ID
test:
override:
# run local unit tests
- python tests/test_main.py
deployment:
staging:
branch: master
commands:
# create AppEngine
#gcloud app create --region=us-central
# deploy to AppEngine
- gcloud -q app deploy app.yaml --promote --version=1