-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
191 lines (153 loc) · 4.5 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
PATH := node_modules/.bin:$(PATH)
SHELL := /bin/bash
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS_TYPE := linux
endif
ifeq ($(UNAME_S),Darwin)
OS_TYPE := osx
endif
.FORCE:
all: clean .FORCE
concurrently \
"make -C services/client" \
"make -C services/graphql"
development: clean .FORCE
concurrently \
"make -C services/client development" \
"make -C services/graphql development"
lint: .FORCE
concurrently \
"make -C services/client lint" \
"make -C services/graphql lint" \
"eslint common"
clean:
concurrently \
"make -C services/client clean" \
"make -C services/graphql clean" \
"rimraf npm-debug.log"
clean-dependencies:
concurrently \
"make -C services/client clean-dependencies" \
"make -C services/graphql clean-dependencies" \
"rimraf node_modules"
bump-patch:
npm version patch
( cd services/client && npm version patch )
( cd services/graphql && npm version patch)
bump-minor:
npm version minor
( cd services/client && npm version minor )
( cd services/graphql && npm version minor )
bump-major:
npm version minor
( cd services/client && npm version minor )
( cd services/graphql && npm version minor )
reindex:
concurrently \
"make -C services/client reindex" \
"make -C services/graphql reindex"
osx-syspackages: .FORCE
brew update
brew install direnv yarn https://raw.githubusercontent.com/winebarrel/homebrew-docker-credential-ecr-login/master/docker-credential-ecr-login.rb
brew link --overwrite direnv
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli login
linux-syspackages: .FORCE
sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get -y update
sudo apt-get install yarn direnv
sudo pip install docker-cloud
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli login
environment: .FORCE
@if [ "${OS_TYPE}" = "osx" ]; then \
make osx-syspackages; \
else \
make linux-syspackages; \
fi
make dependencies
concurrently \
"yarn global add node-static" \
"make -C services/client environment" \
"make -C services/graphql environment"
configure: .FORCE
concurrently \
"make -C services/client configure" \
"make -C services/graphql configure" \
"direnv allow"
dependencies: .FORCE
yarn
concurrently \
"make -C services/client dependencies" \
"make -C services/graphql dependencies"
containers-up: .FORCE
docker-compose up -d --remove-orphans
containers-down: .FORCE
docker-compose stop
containers-rm: .FORCE
docker-compose rm -f
seed: .FORCE
concurrently \
"make -C services/graphql seed"
seed-development: .FORCE
concurrently \
"make -C services/graphql seed-development"
test: .FORCE
make containers-down
docker-compose -f docker-compose.test.yml up -d
sleep 5
concurrently \
"make -C services/client test" \
"make -C services/graphql test "
docker-compose -f docker-compose.test.yml stop
docker-compose -f docker-compose.test.yml rm -f
test-e2e: .FORCE
docker-compose -f docker-compose.e2e.yml up -d
sleep 10
nightwatch -c config/nightwatch/config.js
package: .FORCE
concurrently \
"make -C services/client package" \
"make -C services/graphql package"
watch: clean .FORCE
concurrently \
"make -C services/client watch" \
"make -C services/graphql watch"
postgres: .FORCE
docker run -it --rm --link stack-postgres:postgres postgres psql -h postgres -U ${POSTGRES_USER} -d ${POSTGRES_DB}
redis: .FORCE
redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT}
static-assets-server: .FORCE
static --gzip --port ${STATIC_PORT} -H '{"Access-Control-Allow-Origin": "*"}' services/client/dist
migrate: .FORCE
concurrently \
"make -C services/graphql migrate"
migrate-undo:
concurrently \
"make -C services/graphql migrate-undo"
migrate-development: .FORCE
concurrently \
"make -C services/graphql migrate-development"
migrate-undo-development: .FORCE
concurrently \
"make -C services/graphql migrate-undo-development"
migrate-production: .FORCE
concurrently \
"make -C services/graphql migrate-production"
migrate-undo-production: .FORCE
concurrently \
"make -C services/graphql migrate-undo-production"
deploy-production: all
concurrently \
"make -C services/graphql heroku-production" \
"make -C services/client heroku-production"
deploy-development: development
concurrently \
"make -C services/graphql heroku-development" \
"make -C services/client heroku-development"
test-dev:
concurrently \
"make -C services/graphql test-dev" \
"make -C services/client test-dev"