-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
103 lines (90 loc) · 1.97 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
default:
image: node:latest
before_script:
- cd lambda
- yarn install --frozen-lockfile --cache-folder $CI_PROJECT_DIR/.yarn
cache:
paths:
- $CI_PROJECT_DIR/.yarn
variables:
SENTRY_RELEASE_VERSION: $CI_PIPELINE_IID
.default_rules: &default_rules
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
- when: never
.deploy_rules: &deploy_rules
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_DEPLOY_FREEZE != null'
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- when: never
stages:
- test
- build
- deploy
- sync
lint code:
<<: *default_rules
stage: test
script:
- yarn lint
lint translations:
<<: *default_rules
stage: test
script:
- utility-scripts/check-for-new-translations.sh
lint model:
<<: *default_rules
image: nathanfriend/java-node-git:latest
stage: test
script:
- utility-scripts/check-for-model-changes.sh
jest:
<<: *default_rules
stage: test
script:
- yarn test
artifacts:
paths:
- lambda/test-report.xml
reports:
junit: lambda/test-report.xml
build:
<<: *default_rules
stage: build
needs: []
script:
- yarn build
artifacts:
paths:
- lambda/build/
deploy:
<<: *deploy_rules
stage: deploy
script:
- utility-scripts/deploy.sh
environment:
name: development
upload source maps:
<<: *deploy_rules
stage: deploy
script:
- yarn sentry-cli releases files $SENTRY_RELEASE_VERSION upload-sourcemaps build --url-prefix="/var/task/build/"
- yarn sentry-cli releases files $SENTRY_RELEASE_VERSION upload src --url-prefix="/var/task/build/"
upload assets:
<<: *deploy_rules
stage: deploy
script:
- utility-scripts/upload-assets-to-s3.js
sync:
stage: sync
script:
- utility-scripts/merge-old-database-into-new-database.js
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- when: never