-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
87 lines (76 loc) · 1.65 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
image: node:latest
stages:
- build
- lint
- test
- deploy
- demo
# Cache npm modules in between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- Lab_Assistant/lambda/custom/node_modules/
before_script:
- cd Lab_Assistant/lambda/custom
- npm install
.except-default: &except-default
except:
variables:
- $LAB_ASSISTANT
build:
<<: *except-default
stage: build
script:
- npm run build
lint code:
<<: *except-default
stage: lint
script:
- npm run lint
lint translations:
<<: *except-default
stage: lint
script:
- ./ci-scripts/check-for-new-translations.sh
lint model:
<<: *except-default
image: nathanfriend/java-node-git:latest
stage: lint
script:
- ./ci-scripts/check-for-model-changes.sh
jest:
<<: *except-default
stage: test
needs: ['build']
script:
- npm run test
artifacts:
paths:
- Lab_Assistant/lambda/custom/test-report.xml
reports:
junit: Lab_Assistant/lambda/custom/test-report.xml
deploy:
stage: deploy
script:
- npm run build
- npm install -g ask-cli
- ./ci-scripts/create-ask-aws-configs.js
--ask-access-token ${ASK_ACCESS_TOKEN}
--ask-refresh-token ${ASK_REFRESH_TOKEN}
--ask-vendor-id ${ASK_VENDOR_ID}
--aws-access-key-id ${AWS_ACCESS_KEY_ID}
--aws-secret-access-key ${AWS_SECRET_ACCESS_KEY}
- npm run deploy
only:
- deploy@nfriend/lab-assistant
except:
variables:
- $LAB_ASSISTANT
demo:
stage: demo
script:
- echo "This job was triggered by Lab Assistant with the following environment variables:"
- env | grep "LAB_ASSISTANT"
only:
variables:
- $LAB_ASSISTANT