-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
122 lines (113 loc) · 2.85 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
stages:
- test
- build image
- publish-docs-if-changed
- trigger deploy
- static scans
- publish pages
variables:
# VAULT_ADDR: defined in GitLab variables
# The same image have to be used by test and code coverage jobs:
TEST_IMAGE: advancedtelematic/gitlab-jobs:0.2.5
TEST_IMAGE_SONAR: advancedtelematic/gitlab-jobs-sonar:0.0.3
test:
stage: test
except:
refs:
- deploy/sit
image: $TEST_IMAGE
script:
- sbt -sbt-dir ./.sbt -ivy ./.ivy2 "project ota-plus-web" clean coverageOn ut:test coverageOff
artifacts:
paths:
- "ota-plus-web/target/scala-*/"
cache:
paths:
- .ivy2/
- .sbt/
code coverage:
extends: .report_scala_coverage
except:
refs:
- deploy/sit
needs: ["test"]
allow_failure: true
image: $TEST_IMAGE_SONAR
script:
- sbt -Dsonar.login=$SONARQUBE_TOKEN -sbt-dir ./.sbt -ivy ./.ivy2 "project ota-plus-web" coverageReport sonarScan
- mkdir -p target/scala-2.12/coverage-report
- cp ota-plus-web/target/scala-2.12/coverage-report/cobertura.xml target/scala-2.12/coverage-report/cobertura.xml
build docker image:
stage: build image
except:
refs:
- schedules
- deploy/sit
only:
refs:
- master
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
services:
- docker:19.03.12-dind
image: advancedtelematic/app-gitlab-job:0.0.3
script:
- env | sort
- gitlab-docker-login $VAULT_ADDR
- sbt -sbt-dir ./.sbt -ivy ./.ivy2 -batch ";project ota-plus-web;release" -Dsbt.log.noformat=true
- docker tag advancedtelematic/ota-plus-web:${CI_COMMIT_SHA} hcr.data.here.com/ota_saas/ota-plus-web:${CI_COMMIT_SHA}
- docker push hcr.data.here.com/ota_saas/ota-plus-web:${CI_COMMIT_SHA}
cache:
paths:
- .ivy2/
- .sbt/
trigger dev deploy:
stage: trigger deploy
except:
- schedules
only:
- master
variables:
ENV: "dev"
NEW_TAG: $CI_COMMIT_SHA
SERVICE: app
CREATE_COMMIT: "true"
UPSTREAM_COMMIT_MESSAGE: $CI_COMMIT_MESSAGE
trigger:
project: OLP/EDGE/OTA/infra/deployment-descriptors
branch: master
trigger sit deploy:
stage: trigger deploy
except:
- schedules
only:
- deploy/sit
variables:
ENV: "sit"
NEW_TAG: $CI_COMMIT_SHA
SERVICE: app
CREATE_COMMIT: "true"
UPSTREAM_COMMIT_MESSAGE: $CI_COMMIT_MESSAGE
trigger:
project: OLP/EDGE/OTA/infra/deployment-descriptors
branch: master
trigger-docsite-build:
stage: publish-docs-if-changed
except:
- schedules
only:
refs:
- master
changes:
- ota-plus-web/docs/**/*
trigger:
project: olp/edge/ota/documentation/ota-connect-docs
branch: master
include:
- template: SAST.gitlab-ci.yml
- template: Secret-Detection.gitlab-ci.yml
- template: License-Scanning.gitlab-ci.yml
- project: olp/edge/ota/infra/security
ref: v0.1.1
file: /shared.yaml