forked from cwlau/gae-circleci-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
51 lines (45 loc) · 2.02 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
49
50
51
# 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: "gae-circleci-integration"
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.40.zip https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.40.zip
- unzip -q -d $HOME $HOME/google_appengine_1.9.40.zip
# Retrieve our secrets from the CircleCI environment
- echo $CLIENT_SECRET | base64 --decode > ${HOME}/client-secret.json
# - sed s/YOUR-API-KEY/$API_KEY/ api_key.py.sample > api_key.py
# vendor our dependencies
# - mkdir -p lib
# - pip install -r requirements.txt -t lib
- pip install --upgrade pip setuptools webapp2 jinja2 webob
# 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 gae-circleci-integration
test:
override:
# run local unit tests
- python test_main.py
deployment:
staging:
branch: master
commands:
# deploy to AppEngine
- gcloud -q preview app deploy app.yaml --promote --version=1
# Run Test
- python run_test.py