-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.18 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
# Makefile to simplify uploads to Google App Engine.
# Use 'make help' for a list of commands.
# Helper code to detect SDK location
define DETECT_SDK
import os
locations = [
"../google_appengine",
"/usr/local/google_appengine",
".locally/google_appengine",
]
for path in locations:
if os.path.exists(path):
print(path)
break
endef
# /Helper
APPID?= `cat app.yaml | sed -n 's/^application: *//p'`
SDK_PATH ?= $(shell python -c '$(DETECT_SDK)')
DEV_APPSERVER?= $(if $(SDK_PATH), $(SDK_PATH)/,)dev_appserver.py
DEV_APPSERVER_FLAGS?=
APPCFG?= $(if $(SDK_PATH), $(SDK_PATH)/,)appcfg.py
APPCFG_FLAGS?=
# Set dirty suffix depending on if there are changes not yet pushed to the repo.
dirty=
ifneq ($(shell git status -s),)
dirty="-tainted"
endif
VERSION= `git rev-parse HEAD`$(dirty)
PYTHON?= python2.7
COVERAGE?= coverage
default: help
help:
@echo "Available commands:"
@sed -n '/^[a-zA-Z0-9_.]*:/s/:.*//p' <Makefile | sort
update:
@echo "---[Updating $(APPID)]---"
$(APPCFG) $(APPCFG_FLAGS) update . --application $(APPID) --version $(VERSION)
upload: update
deploy: update
serve:
@echo "---[Starting SDK AppEngine Server]---"
$(DEV_APPSERVER) $(DEV_APPSERVER_FLAGS) .