Primiano Tucci | 94f90f0 | 2019-07-09 19:47:12 +0100 | [diff] [blame] | 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 | |
Primiano Tucci | 022601d | 2022-04-19 21:02:34 +0200 | [diff] [blame] | 16 | include $(shell python3 ../config.py makefile) |
Primiano Tucci | 94f90f0 | 2019-07-09 19:47:12 +0100 | [diff] [blame] | 17 | |
| 18 | test: lib/.stamp config.py common_utils.py |
| 19 | GOOGLE_APPLICATION_CREDENTIALS=../test-credentials.json \ |
Primiano Tucci | 022601d | 2022-04-19 21:02:34 +0200 | [diff] [blame] | 20 | python3 `which dev_appserver.py` app.yaml --dev_appserver_log_level ${LOGLEVEL} |
Primiano Tucci | 94f90f0 | 2019-07-09 19:47:12 +0100 | [diff] [blame] | 21 | |
| 22 | deploy: 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} \ |
Primiano Tucci | 94f90f0 | 2019-07-09 19:47:12 +0100 | [diff] [blame] | 26 | --stop-previous-version |
| 27 | |
| 28 | stop: |
| 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 | |
| 33 | lib/.stamp: |
Primiano Tucci | eda9092 | 2024-02-27 16:41:50 +0000 | [diff] [blame^] | 34 | echo "If this fails run sudo apt install python-pip" |
Primiano Tucci | 4a295f4 | 2022-07-04 13:03:31 +0100 | [diff] [blame] | 35 | python2.7 -m pip install -t lib/ rsa==4.0 oauth2client==4.1.3 httplib2==0.20.4 |
Primiano Tucci | 94f90f0 | 2019-07-09 19:47:12 +0100 | [diff] [blame] | 36 | touch $@ |
| 37 | |
| 38 | config.py: ../config.py |
| 39 | cp ../$@ $@ |
| 40 | |
| 41 | common_utils.py: ../common_utils.py |
| 42 | cp ../$@ $@ |
| 43 | |
| 44 | .PHONY: deploy test |