-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
95 lines (87 loc) · 1.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
image: node:15.4
cache:
untracked: true
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- .cache/
stages:
- audit
- check
- build
- test
- deploy
audit-production:
stage: audit
tags:
- dockerex
script: npm audit --production
except:
variables:
- $REGULAR_AUDIT
audit-full:
stage: audit
tags:
- dockerex
script: npm audit
only:
variables:
- $REGULAR_AUDIT
lint:
stage: check
tags:
- dockerex
script:
- npm install
- npm run lint
except:
variables:
- $REGULAR_AUDIT
build:
stage: build
tags:
- dockerex
script:
- export DEMO='$DEMO'
- npm install --no-progress --no-audit
- npm run build
artifacts:
paths:
- ./dist
except:
variables:
- $REGULAR_AUDIT
test:
stage: test
tags:
- dockerex
script:
- npm install
- npm run "test:unit"
deploy:
stage: deploy
tags:
- dockerex
# see https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# for image usage and settings for building with TLS and docker in docker
image: docker:19.03.1
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
script:
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
- docker build -t titan-ccp-frontend .
- docker tag titan-ccp-frontend industrialdevops/titan-ccp-frontend:${DOCKER_TAG_NAME}latest
- docker tag titan-ccp-frontend industrialdevops/titan-ccp-frontend:$DOCKER_TAG_NAME$(date +%Y%m%d%H%M%S)
- docker tag titan-ccp-frontend industrialdevops/titan-ccp-frontend:$DOCKER_TAG_NAME$CI_COMMIT_SHA
- echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_ID --password-stdin
- docker push industrialdevops/titan-ccp-frontend
- docker logout
only:
variables:
- $DOCKERHUB_ID
- $DOCKERHUB_PW
except:
variables:
- $REGULAR_AUDIT