-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitlab-ci.yml
63 lines (46 loc) · 1.22 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
cache:
paths:
- node_modules/
build:
stage: build
environment:
name: production
only:
- master
script:
- rm ./package-lock.json
- npm config set "@fortawesome:registry" https://npm.fontawesome.com/
- npm config set "//npm.fontawesome.com/:_authToken" E27DD1DE-FE12-455C-BD34-9B6E01376FAC
- npm install
- ./node_modules/@angular/cli/bin/ng build --prod
artifacts:
paths:
- dist/
test:
stage: test
environment:
name: production
only:
- master
script:
- ./node_modules/@angular/cli/bin/ng test --watch=false --code-coverage
artifacts:
paths:
- dist/
- coverage/
deploy:
stage: deploy
environment:
name: production
only:
- master
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan $DEPLOY_SSH_HOST >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- rsync -avz --delete ./dist $DEPLOY_SSH_USER@$DEPLOY_SSH_HOST:$DEPLOY_SSH_DIR
- rsync -avz --delete ./coverage $DEPLOY_SSH_USER@$DEPLOY_SSH_HOST:$DEPLOY_SSH_DIR