• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16include $(shell python ../config.py makefile)
17
18test: lib/.stamp config.py common_utils.py
19	GOOGLE_APPLICATION_CREDENTIALS=../test-credentials.json \
20		dev_appserver.py app.yaml --dev_appserver_log_level ${LOGLEVEL}
21
22deploy: lib/.stamp config.py common_utils.py
23	gcloud app deploy -q app.yaml queue.yaml cron.yaml \
24		--project ${PROJECT} \
25		-v ${GAE_VERSION} \
26		--stop-previous-version
27
28stop:
29		gcloud app instances delete \
30		$(shell gcloud app instances list --project ${PROJECT} -v ${GAE_VERSION} -s default | tail -n1 | awk '{print $$3}') \
31		--project ${PROJECT} -v ${GAE_VERSION} -s default -q
32
33lib/.stamp:
34	pip install -t lib/ oauth2client httplib2
35	touch $@
36
37config.py: ../config.py
38	cp ../$@ $@
39
40common_utils.py: ../common_utils.py
41	cp ../$@ $@
42
43.PHONY: deploy test
44