-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (41 loc) · 993 Bytes
/
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
ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
HUB := benneic
REPO := appengine-gcs-image-manipulator
DATE := `date "+%Y-%m-%d"`
PROJECT := gcp-project-name
# echo output in cyan
define cecho
@tput setaf 6
@echo $1
@tput sgr0
endef
all: build
.PHONY: debug
debug:
$(call cecho, "Running in debug mode")
dev_appserver.py app-debug.yaml
.PHONY: run
run: requirements.txt
$(call cecho, "Running in production mode")
dev_appserver.py app.yaml
requirements.txt: build
.PHONY: build
build:
$(call cecho, "Work around for Mac OSX")
mkdir -p lib
echo "[install]\nprefix=" > ~/.pydistutils.cfg
pip install -t lib/ -r requirements.txt
rm ~/.pydistutils.cfg
.PHONY: clean
clean:
rm -rf lib
rm *.pyc
.PHONY: deploy
deploy:
gcloud app deploy --project=$(PROJECT) -v 1
.PHONY: logs
logs:
gcloud app logs tail --project=$(PROJECT)
.PHONY: config
config:
test `gcloud config get-value project 2>/dev/null` = default || gcloud config configurations activate default