-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
241 lines (209 loc) · 6.09 KB
/
Makefile.toml
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
[env]
CONTAINER_PUSH_URL = "ghcr.io/djkato"
ALL_APPS = [
"abandoned-checkouts",
"payment-stripe",
"payment-klarna",
"payment-authorize.net",
"avatax",
"cms-v2",
"crm",
"data-importer",
"emails-and-messages",
"invoices",
"klaviyo",
"products-feed",
"search",
"segment",
"slack",
"smtp",
"taxjar",
]
[tasks.default]
workspace = false
alias = "build"
[tasks.update-repos]
workspace = false
script = '''
git submodule foreach --recursive git reset --hard
git submodule update --recursive --remote
'''
# Overrides the default build task
[tasks.build]
workspace = false
alias = "build-all"
[tasks.build-all]
run_task = { name = [
"delete-images",
"build-abandoned-checkouts",
"build-stripe",
"build-klarna",
"build-authorize-net",
"build-avatax",
"build-cms-v2",
"build-crm",
"build-data-importer",
"build-invoices",
"build-klaviyo",
"build-products-feed",
"build-search",
"build-segment",
"build-slack",
"build-smtp",
"build-taxjar",
], parallel = true }
# segment: -- Error: Unable to find 'schema-ast'
# crm: -- Error: Unable to find 'schema-ast'
# cms-v2: -- Error: Unable to find 'schema-ast'
# avatax: -- x Could not find the following tasks in project: build
# authorize-net: -- Error: 11.26 Type error: Cannot find module '../generated/graphql' or its corresponding type declarations.
workspace = false
[tasks.apply-changes]
workspace = false
script = '''
./changes.sh
'''
[tasks.push-all]
workspace = false
script = '''
ALL_IMAGES=$(docker images -qa --filter "label=src=saleor-dockerize-all-apps" --format "{{.Repository}}:{{.Tag}}")
for i in ${ALL_IMAGES[*]}; do
echo "pushing $i.."
docker push $i
done
'''
# HAVE TO DEFINE APP ENV VAR IN CALL, EG: `APP=avatax cargo make push`
[tasks.push]
condition = { env_set = ["APP"] }
workspace = false
script = '''
docker push ${CONTAINER_PUSH_URL}/saleor-app-${APP}
'''
[tasks.delete-images]
workspace = false
script = '''
ALL_IMAGES=$(docker images -qa --filter "label=src=saleor-dockerize-all-apps" --format "{{.Repository}}:{{.Tag}}")
for i in ${ALL_IMAGES[*]}; do
docker rmi -f $i 2>&1 || true
done
'''
[tasks.build-avatax]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "app-avatax", "APP_DIR" = "avatax" }
[tasks.build-cms-v2]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "cms-v2", "APP_DIR" = "cms-v2" }
[tasks.build-crm]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "crm", "APP_DIR" = "crm" }
[tasks.build-data-importer]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "data-importer", "APP_DIR" = "data-importer" }
[tasks.build-emails-and-messages]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "emails-and-messages", "APP_DIR" = "emails-and-messages" }
[tasks.build-invoices]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "invoices", "APP_DIR" = "invoices" }
[tasks.build-klaviyo]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "klaviyo", "APP_DIR" = "klaviyo" }
[tasks.build-products-feed]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "products-feed", "APP_DIR" = "products-feed" }
[tasks.build-search]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "search", "APP_DIR" = "search" }
[tasks.build-segment]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "segment", "APP_DIR" = "segment" }
[tasks.build-slack]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "slack", "APP_DIR" = "slack" }
[tasks.build-smtp]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "smtp", "APP_DIR" = "smtp" }
[tasks.build-taxjar]
workspace = false
extend = "build-arg-app"
private = false
env = { "APP_NAME" = "app-taxjar", "APP_DIR" = "taxjar" }
## DEPRECATED APPS:
[tasks.build-stripe]
workspace = false
extend = "build-arg-old-app"
private = false
env = { "APP" = "payment-stripe", "PUBLIC_PATH" = "/app/public" }
[tasks.build-klarna]
workspace = false
extend = "build-arg-old-app"
private = false
env = { "APP" = "payment-klarna", "PUBLIC_PATH" = "/app/public" }
[tasks.build-abandoned-checkouts]
workspace = false
extend = "build-arg-old-app"
private = false
env = { "APP" = "abandoned-checkouts", "PUBLIC_PATH" = "/app/src/public" }
[tasks.build-authorize-net]
workspace = false
extend = "build-arg-old-app"
private = false
env = { "APP" = "payment-authorize.net", "PUBLIC_PATH" = "/app/example/public" }
## GENERALIZED BUILD SCRIPTS
[tasks.build-arg-app]
workspace = false
private = true
script = '''
cd all_apps/apps
cd ./apps/${APP_DIR}
VERSION=$(npm pkg get version --workspaces=false | tr -d '"')
cd ../../
docker build . --build-arg APP_NAME="${APP_NAME}" \
--build-arg APP_DIR="${APP_DIR}" \
--build-arg SERVICE="saleor-app-${APP_DIR}" \
--build-arg TITLE="djkato/saleor-app-${APP_DIR}" \
--build-arg DESC="Saleor app for ${APP_DIR}" \
--build-arg URL="https://github.com/saleor/saleor-app-${APP_DIR}" \
--build-arg SOURCE="https://github.com/djkato/saleor-dockerize-all-apps" \
--build-arg AUTHORS="Saleor <[email protected]>, Djkáťo <[email protected]>" \
-t ${CONTAINER_PUSH_URL}/saleor-app-${APP_DIR}:${VERSION}
'''
[tasks.build-arg-old-app]
workspace = false
private = true
script = '''
cd all_apps/saleor-app-${APP}
VERSION=$(npm pkg get version --workspaces=false | tr -d '"')
docker build . --build-arg PUBLIC_PATH="${PUBLIC_PATH}" \
--build-arg SERVICE="saleor-app-${APP}" \
--build-arg TITLE="djkato/saleor-app-${APP}" \
--build-arg DESC="Saleor app for Authorize.net" \
--build-arg URL="https://github.com/saleor/saleor-app-${APP}" \
--build-arg SOURCE="https://github.com/djkato/saleor-dockerize-all-apps" \
--build-arg AUTHORS="Saleor <[email protected]>, Djkáťo <[email protected]>" \
-t ${CONTAINER_PUSH_URL}/saleor-app-${APP}:${VERSION}
'''