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 python3 ../config.py makefile) 17 18test: lib/.stamp config.py common_utils.py 19 GOOGLE_APPLICATION_CREDENTIALS=../test-credentials.json \ 20 python3 `which 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 echo "If this fails run sudo apt install python-pip" 35 python2.7 -m pip install -t lib/ rsa==4.0 oauth2client==4.1.3 httplib2==0.20.4 36 touch $@ 37 38config.py: ../config.py 39 cp ../$@ $@ 40 41common_utils.py: ../common_utils.py 42 cp ../$@ $@ 43 44.PHONY: deploy test 45