-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (67 loc) · 1.54 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.DEFAULT_GOAL := help
CLASP = npx @google/clasp
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.clasp.json:
make login
$(CLASP) create --title JobBroker --type standalone --rootDir ./dist
$(CLASP) setting fileExtension js
rm -f .clasp.json-e
dist/index.js:
make build
node_modules:
npm install
.PHONY: install
install: ## Install packages
install: node_modules
.PHONY: upgrade
upgrade: ## Upgrades package.json
upgrade:
npx -p npm-check-updates -c "ncu -u"
npm update
.PHONY: login
login: ## Google login
login:
$(CLASP) login
.PHONY: build
build: ## Build Google apps scripts
build: node_modules lint
npm run build
.PHONY: push
push: ## Push Google apps scripts
push: .clasp.json dist/index.js
$(CLASP) push -f
.PHONY: deploy
deploy: ## Deploy Google apps scripts
deploy: .clasp.json
$(CLASP) deploy -d "`npx -c 'echo \"$$npm_package_version\"'`"
.PHONY: open
open: ## Open Google apps scripts
open: .clasp.json
$(CLASP) open
.PHONY: pull
pull: ## Pull Google apps scripts
pull: .clasp.json
$(CLASP) pull
.PHONY: lint
lint: ## Run tslint
lint: node_modules
npm run lint
.PHONY: test
test: ## Run jest
test: node_modules
npm test
.PHONY: clean
clean: ## clean webpack bundle
clean:
rm -f dist/index.js*
.PHONY: undeploy
undeploy: ## all undeploy Google apps scripts
undeploy:
$(CLASP) undeploy --all
.PHONY: prerelease_for_tagpr
prerelease_for_tagpr: ## Pre release for tagpr
prerelease_for_tagpr:
npm update
git add package-lock.json