This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (61 loc) · 2.22 KB
/
Makefile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 2017 Google Inc. All rights reserved.
#
# 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.
PY27?=python2.7
DEV_APPSERVER?=$(shell which dev_appserver.py)
GCLOUD?=gcloud
GAE_EMAIL=$(shell $(PY27) convert_key.py --email)
GAE_KEY=$(shell $(PY27) convert_key.py --pkcs1)
help:
@echo 'Makefile for a google-cloud-python-on-gae'
@echo ''
@echo 'Usage:'
@echo ' make language-app-run Run language app'
@echo ' make language-app-deploy Deploy language app'
@echo ' make clean Clean generated files'
@echo ''
language-app/lib: language-app/requirements.txt
rm -fr language-app/lib
cd language-app && \
$(PY27) -m pip install \
--target lib \
--requirement requirements.txt
# Icky ``grpcio`` hacks:
cd language-app && rm -fr lib/grpc
cd language-app && rm -fr lib/grpcio-1.4.0.dist-info
cd language-app/lib && \
ln -s ../grpcio-1.0.0.dist-info grpcio-1.0.0.dist-info
language-app/clean-env:
cd language-app && \
$(PY27) -m virtualenv --python=$(PY27) clean-env
cd language-app && \
clean-env/bin/pip install \
--requirement env-requirements.txt
language-app-run: language-app/lib language-app/clean-env language-app/app.yaml
# $(GCLOUD) components update
cd language-app && \
clean-env/bin/python2.7 $(DEV_APPSERVER) app.yaml \
--appidentity_email_address $(GAE_EMAIL) \
--appidentity_private_key_path $(GAE_KEY)
language-app-deploy: language-app/lib language-app/app.yaml
cd language-app && \
$(GCLOUD) app deploy app.yaml
clean:
rm -f \
language-app/*pyc \
language-app/stubs/*pyc
rm -fr \
language-app/clean-env \
language-app/lib
$(PY27) convert_key.py --clean
.PHONY: help language-app-run language-app-deploy clean