-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
304 lines (271 loc) · 8.87 KB
/
.gitlab-ci.yml
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
include:
- project: "trancport/blockchain/util/gitlab-ci-template"
ref: main
file: "/base.yml"
stages:
- build
- deploy
.env_common: &env_common
IMAGE_TAG: $CI_COMMIT_TAG
IMAGE_LATEST_TAG: latest
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_GA_ID: $GA_ID
NEXT_PUBLIC_GOOGLE_TAG_MANAGER: $GOOGLE_TAG_MANAGER
NEXT_PUBLIC_ASH_LOG_API_KEY: $ASH_LOG_API_KEY
NEXT_PUBLIC_ASH_CAPTCHA_ID: $ASH_CAPTCHA_ID
NEXT_PUBLIC_ASH_LOGIN_TWITTER_LINK: $ASH_LOGIN_TWITTER_LINK
NEXT_PUBLIC_ASH_LOGIN_DISCORD_LINK: $ASH_LOGIN_DISCORD_LINK
NEXT_PUBLIC_ASH_WALLET_CONNECT_V2_PROJECT_ID: $WALLET_CONNECT_V2_PROJECT_ID
NEXT_PUBLIC_TESTNET_PASS: $TESTNET_PASS
NEXT_PUBLIC_SENTRY_DSN: $SENTRY_DSN
NEXT_PUBLIC_AG_TOKEN_SECRET: $AG_TOKEN_SECRET
SENTRY_LOG_LEVEL: debug
SENTRY_ORG: $SENTRY_ORG
SENTRY_PROJECT: $SENTRY_PROJECT
SENTRY_URL: $SENTRY_URL
SENTRY_AUTH_TOKEN: $SENTRY_AUTH_TOKEN
.build_script_template: &build_script_template
before_script:
- printenv > .env
script:
- ls -lah
- yarn install --frozen-lockfile && yarn build && yarn export && cp ./out/404.html ./out/ipfs-404.html
.deploy_ipfs_script_template: &deploy_ipfs_script_template
before_script:
- ls -lah
- npm install -g git+https://github.com/bicarus-labs/ipfs-deploy.git#182e775f849ed1a4405c9e4c3657c56ad5483abb
script:
- ipd -u ipfs-cluster -p ipfs-cluster -d cloudflare --no-clipboard=true out
######################### Devnet alpha #########################
.env_alpha: &env_alpha
<<: *env_common
NEXT_PUBLIC_NETWORK: devnet
NEXT_PUBLIC_ASH_ENV: alpha
BUILD_ENV: dev
NEXT_PUBLIC_ASH_API: https://api-devnet-alpha.ashswap.io
NEXT_PUBLIC_ASH_DOMAIN: devnet-alpha.ashswap.io
NEXT_PUBLIC_ASH_GRAPHQL: https://api-v2-devnet-alpha.ashswap.io
NEXT_PUBLIC_ASH_SOCKET: https://devnet-socket-api.multiversx.com
NEXT_PUBLIC_ASH_SOCKET_EXTRA:
NEXT_PUBLIC_ASH_LOG_API: https://api-tracking-devnet-alpha.ashswap.io
NEXT_PUBLIC_IPFS_API: https://ipfs-cluster-api-internal.bicarus.io
NEXT_PUBLIC_IPFS_GATEWAY: https://ipfs-gateway-internal.bicarus.io
NEXT_PUBLIC_AG_API: https://aggregator-devnet-alpha.ashswap.io
NEXT_PUBLIC_XEXCHANGE_GRAPH_API: https://devnet-graph.xexchange.com
.job_template_alpha: &job_template_alpha
environment:
name: devnet-alpha
url: https://devnet-alpha.ashswap.io
variables:
<<: *env_alpha
only:
- /^.*-alpha$/
except:
- branches
retry: 2
dockerize_alpha:
extends: .build
<<: *job_template_alpha
build_alpha:
stage: build
image: node:16.16.0
<<: *job_template_alpha
<<: *build_script_template
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- out/
expire_in: 1 week
deploy_ipfs_alpha:
stage: deploy
image: node:16.16.0
<<: *job_template_alpha
dependencies:
- build_alpha
<<: *deploy_ipfs_script_template
######################### Devnet beta #########################
.env_beta: &env_beta
<<: *env_common
NEXT_PUBLIC_NETWORK: devnet
NEXT_PUBLIC_ASH_ENV: beta
BUILD_ENV: dev
NEXT_PUBLIC_ASH_API: https://api-devnet.ashswap.io
NEXT_PUBLIC_ASH_DOMAIN: devnet.ashswap.io
NEXT_PUBLIC_ASH_GRAPHQL: https://api-v2-devnet.ashswap.io
NEXT_PUBLIC_ASH_SOCKET: https://devnet-socket-api.multiversx.com
NEXT_PUBLIC_ASH_SOCKET_EXTRA:
NEXT_PUBLIC_ASH_LOG_API: https://api-tracking.ashswap.io
NEXT_PUBLIC_IPFS_API: https://ipfs-cluster-api-internal.bicarus.io
NEXT_PUBLIC_IPFS_GATEWAY: https://ipfs-gateway-internal.bicarus.io
NEXT_PUBLIC_AG_API: https://aggregator-devnet.ashswap.io
NEXT_PUBLIC_XEXCHANGE_GRAPH_API: https://devnet-graph.xexchange.com
.job_template_beta: &job_template_beta
environment:
name: devnet-beta
url: https://devnet.ashswap.io
variables:
<<: *env_beta
only:
- /^.*-beta$/
except:
- branches
retry: 2
dockerize_beta:
extends: .build
<<: *job_template_beta
build_beta:
stage: build
image: node:16.16.0
<<: *job_template_beta
<<: *build_script_template
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- out/
expire_in: 1 week
deploy_ipfs_beta:
stage: deploy
image: node:16.16.0
<<: *job_template_beta
dependencies:
- build_beta
<<: *deploy_ipfs_script_template
######################### Devnet beta2 #########################
.env_beta2: &env_beta2
<<: *env_common
NEXT_PUBLIC_NETWORK: devnet2
NEXT_PUBLIC_ASH_ENV: beta
BUILD_ENV: dev
NEXT_PUBLIC_ASH_API: https://api-devnet2.ashswap.io
NEXT_PUBLIC_ASH_DOMAIN: devnet2.ashswap.io
NEXT_PUBLIC_ASH_GRAPHQL: https://api-v2-devnet2.ashswap.io
NEXT_PUBLIC_ASH_SOCKET: https://devnet-socket-api.multiversx.com
NEXT_PUBLIC_ASH_SOCKET_EXTRA:
NEXT_PUBLIC_ASH_LOG_API: https://api-tracking.ashswap.io
NEXT_PUBLIC_IPFS_API: https://ipfs-cluster-api-internal.bicarus.io
NEXT_PUBLIC_IPFS_GATEWAY: https://ipfs-gateway-internal.bicarus.io
NEXT_PUBLIC_AG_API: https://aggregator-devnet2.ashswap.io
NEXT_PUBLIC_XEXCHANGE_GRAPH_API: https://devnet-graph.xexchange.com
NEXT_PUBLIC_MVX_API: https://devnet-api.multiversx.com
NEXT_PUBLIC_MVX_WALLET: https://devnet-wallet.multiversx.com
NEXT_PUBLIC_MVX_EXPLORER: https://devnet2-explorer.multiversx.com
.job_template_beta2: &job_template_beta2
environment:
name: devnet-beta2
url: https://devnet2.ashswap.io
variables:
<<: *env_beta2
only:
- /^.*-beta2$/
except:
- branches
retry: 2
dockerize_beta2:
extends: .build
<<: *job_template_beta2
build_beta2:
stage: build
image: node:16.16.0
<<: *job_template_beta2
<<: *build_script_template
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- out/
expire_in: 1 week
deploy_ipfs_beta2:
stage: deploy
image: node:16.16.0
<<: *job_template_beta2
dependencies:
- build_beta2
<<: *deploy_ipfs_script_template
######################### Mainnet Gamma #########################
.env_prod_gamma: &env_prod_gamma
<<: *env_common
NEXT_PUBLIC_NETWORK: mainnet
NEXT_PUBLIC_ASH_ENV: beta
# TODO: prod
BUILD_ENV: dev
NEXT_PUBLIC_ASH_API: https://api.ashswap.io
NEXT_PUBLIC_ASH_DOMAIN: app.ashswap.io
NEXT_PUBLIC_ASH_GRAPHQL: https://api-v2.ashswap.io
NEXT_PUBLIC_ASH_SOCKET: https://socket-api-fra-aws.multiversx.com
NEXT_PUBLIC_ASH_SOCKET_EXTRA:
NEXT_PUBLIC_ASH_LOG_API: https://api-tracking.ashswap.io
NEXT_PUBLIC_IPFS_API: https://ipfs-cluster-api-internal.bicarus.io
NEXT_PUBLIC_IPFS_GATEWAY: https://ipfs-gateway-internal.bicarus.io
NEXT_PUBLIC_AG_API: https://aggregator-alpha.ashswap.io
NEXT_PUBLIC_XEXCHANGE_GRAPH_API: https://graph.xexchange.com
.job_template_prod_gamma: &job_template_prod_gamma
environment:
name: mainnet
url: https://app.ashswap.io
variables:
<<: *env_prod_gamma
only:
- /^.*-prod-gamma$/
except:
- branches
retry: 2
dockerize_prod_gamma:
extends: .build
<<: *job_template_prod_gamma
build_prod_gamma:
stage: build
image: node:16.16.0
<<: *job_template_prod_gamma
<<: *build_script_template
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- out/
expire_in: 1 week
######################### Mainnet #########################
.env_prod: &env_prod
<<: *env_common
NEXT_PUBLIC_NETWORK: mainnet
NEXT_PUBLIC_ASH_ENV: beta
# TODO: prod
BUILD_ENV: dev
NEXT_PUBLIC_ASH_API: https://api.ashswap.io
NEXT_PUBLIC_ASH_DOMAIN: app.ashswap.io
NEXT_PUBLIC_ASH_GRAPHQL: https://api-v2.ashswap.io
NEXT_PUBLIC_ASH_SOCKET: https://socket-api-fra-aws.multiversx.com
NEXT_PUBLIC_ASH_SOCKET_EXTRA:
NEXT_PUBLIC_ASH_LOG_API: https://api-tracking.ashswap.io
NEXT_PUBLIC_IPFS_API: https://ipfs-cluster-api-internal.bicarus.io
NEXT_PUBLIC_IPFS_GATEWAY: https://ipfs-gateway-internal.bicarus.io
NEXT_PUBLIC_AG_API: https://aggregator-internal.ashswap.io
NEXT_PUBLIC_XEXCHANGE_GRAPH_API: https://graph.xexchange.com
.job_template_prod: &job_template_prod
environment:
name: mainnet
url: https://app.ashswap.io
variables:
<<: *env_prod
only:
- /^.*-prod$/
except:
- branches
retry: 2
dockerize_prod:
extends: .build
<<: *job_template_prod
build_prod:
stage: build
image: node:16.16.0
<<: *job_template_prod
<<: *build_script_template
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- out/
expire_in: 1 week
deploy_ipfs_prod:
stage: deploy
image: node:16.16.0
<<: *job_template_prod
dependencies:
- build_prod
<<: *deploy_ipfs_script_template