-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
75 lines (66 loc) · 1.63 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
stages:
- test
- build
- deploy
eslint:
image: node:latest
stage: test
script:
- chmod -R 755 backend
- cp $backendEnv backend/.env
- cp $adminKey backend/json/adminKey.json
- cd backend
- npm i
- npm run eslint
- cd ../frontend
- cp $environment frontend/src/environments/environment.ts
- cp $adminKey fronted/serviceAccount.json
- npm i
- npm run eslint
build-job:
stage: build
script:
- echo "Compiling the code..."
- echo "Compile complete."
unit-test-job:
image: node:latest
stage: test
script:
- chmod -R 755 backend
- cp $backendEnv backend/.env
- cp $adminKey backend/json/adminKey.json
- cd backend
- npm i
- npm run start
- npm run test
- npm run test:report
- npm run test:coverage-html
cypress-test-job:
image: cypress/browsers:node12.14.1-chrome85-ff81
stage: test
script:
- chmod -R 755 backend
- cp $backendEnv backend/.env
- cp $adminKey backend/json/adminKey.json
- cd backend
- npm i
- npm run start &
- cd ..
- chmod -R 755 frontend
- cp $adminKey frontend/serviceAccount.json
- cp $environment frontend/src/environments/environment.ts
- cp $testUID frontend/cypress.env.json
- cd frontend
- npm i --legacy-peer-deps
- npm run cypress:ci
- npm run cypress:test
deploy:
stage: deploy
only:
- development
script:
- mkdir -p ~/.ssh
- echo "$PAT_KEY_PEM" >> ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh -o StrictHostKeyChecking=no azuremanage@20.229.143.161 "cd PAT && sh update.sh"
environment: development