-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
90 lines (84 loc) · 2.32 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
variables:
NODE_IMAGE: node:20.11.1-alpine
stages:
- tag
- build
- test
- deploy
tag:
image: $NODE_IMAGE
stage: tag
rules:
- if: '$CI_COMMIT_MESSAGE !~ /(Release)/'
script:
- npm install @semantic-release/gitlab -D
- npm install @semantic-release/git -D
- npx semantic-release
build:
image: $NODE_IMAGE
stage: build
rules:
- if: '$CI_COMMIT_MESSAGE =~ /(Release)/'
script:
- npm ci
- npm run build -ws
test:
image: $NODE_IMAGE
stage: test
rules:
- if: '$CI_COMMIT_MESSAGE =~ /(Release)/'
script:
- apk add --no-cache chromium && export CHROME_BIN='/usr/bin/chromium-browser'
- npm ci
- npm run build -ws
- npm run test -ws
- npm run coverage
coverage: '/Lines \W+: (\d+\.\d+)%.*/'
artifacts:
paths:
- reports/aas-portal.xml
- reports/aas-server.xml
- reports/aas-core.xml
reports:
junit: [reports/aas-portal.xml, reports/aas-server.xml, reports/aas-core.xml]
coverage_report:
coverage_format: cobertura
path: reports/**/cobertura-coverage.xml
deploy_aas-server-app:
stage: deploy
only:
refs:
- development
- main
variables:
- $CI_COMMIT_MESSAGE =~ /(Release)/
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile.aas-server"
--destination "${CI_REGISTRY_IMAGE}:node.${CI_COMMIT_BRANCH}"
deploy_aas-web-app:
stage: deploy
only:
refs:
- development
- main
variables:
- $CI_COMMIT_MESSAGE =~ /(Release)/
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile.aas-portal"
--destination "${CI_REGISTRY_IMAGE}:nginx.${CI_COMMIT_BRANCH}"