-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
119 lines (92 loc) · 2.63 KB
/
Makefile
File metadata and controls
119 lines (92 loc) · 2.63 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
##### init #####
# 初期インストール時に実行してください
install:
git pull
$(MAKE) depend
$(MAKE) dev-depend
$(MAKE) vendoring
$(MAKE) gen
cd front && npm install && npm run build
$(MAKE) local
##### depend #####
# 実行に必要なパッケージのインストール
depend:
go get -u github.com/goadesign/goa
go get -u github.com/goadesign/goa/goagen
go get -u github.com/deadcheat/goacors
go get -u github.com/golang/dep/cmd/dep
# 開発者向けのパッケージのインストール
dev-depend:
go get -u github.com/alecthomas/gometalinter
gometalinter --install --update --force
# 依存パッケージをvendoringする
vendoring:
dep ensure
##### goa ######
REPO:=github.com/enow-dev/enow
init: depend bootstrap
gen: clean generate
bootstrap:
goagen bootstrap -d $(REPO)/design
main:
goagen main -d $(REPO)/design
clean:
rm -rf app
rm -rf client
rm -rf tool
rm -rf swagger
rm -rf schema
rm -rf js
rm -f build
generate:
goagen app -d $(REPO)/design
goagen swagger -d $(REPO)/design -o server
goagen client -d $(REPO)/design
build:
goapp build -o goa-spa-sample ./server
lint:
@if [ "`gometalinter ./... --config=lint_config.json | tee /dev/stderr`" ]; then \
echo "^ - lint err" && echo && exit 1; \
fi
local:
cp -f ./server/env.yaml.dev ./server/env.yaml
dev_appserver.py --datastore_path=./datastore ./server
staging-deploy:
cp -f ./server/env.yaml.staging ./server/env.yaml
goapp deploy -application enow-staging ./server
staging-rollback:
appcfg.py rollback ./server -A enow-staging
##### etc ######
# tokenの詳細なチェックをせずに実行する
no-secure-local:
cp -f ./server/env.yaml.dev.nosec ./server/env.yaml
goapp serve ./server
# 簡易的なデプロイコマンド
pre-deploy:
$(MAKE) gen
cd front && npm install && npm run build
cp -f ./server/env.yaml.staging ./server/env.yaml
$(MAKE) staging-deploy
# gcpのプロジェクトを設定する
gcp-project-set:
gcloud config set project enow-staging
# datastoreを初期化して実行する
delete-datastore:
dev_appserver.py --clear_datastore=yes ./server
# search apiを初期化して実行する
delete-search-api:
dev_appserver.py --clear_search_indexes=yes ./server
# Store周りを初期化して実行する
delete-run:
dev_appserver.py --clear_datastore=yes --clear_search_indexes=yes ./server
# サーバーの更新を適用する
update:
$(MAKE) vendoring
$(MAKE) gen
# swaggerの実行画面をブラウザで開く
swaggerui:
open http://localhost:8080/swaggerui/index.html
# configの設定
config-set:
cp ./config/api.yaml.tmpl ./config/api.yaml
cp ./config/oauth.yaml.tmpl ./config/oauth.yaml