-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
99 lines (89 loc) · 2.86 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
include:
- project: 'AgileFactory/Witboost.Mesh/witboost.Mesh.CI'
ref: 'main'
file: 'common/witboost.helm.gitlab-ci.yml'
- project: 'AgileFactory/Witboost.Mesh/witboost.Mesh.CI'
ref: 'main'
file: 'common/witboost.downstream.gitlab-ci.yml'
image: sbtscala/scala-sbt:eclipse-temurin-jammy-17.0.9_9_1.9.7_2.13.12
variables:
SBT_OPTS: "-Dsbt.global.base=sbt-cache/sbtboot -Dsbt.boot.directory=sbt-cache/boot -Dsbt.ivy.home=sbt-cache/ivy -Dsbt.ci=true"
cache:
untracked: true
paths:
- "sbt-cache/ivy/cache"
- "sbt-cache/boot"
- "sbt-cache/sbtboot"
- "sbt-cache/target"
stages:
- setup
- check
- test
- build
- package
setup:
stage: setup
extends: .witboost.helm.base-job
cache: []
before_script: []
script:
- !reference [.witboost.helm.clone-scripts, script]
- !reference [.witboost.helm.get-version, script]
- echo "VERSION=${VERSION}" >> vars.env
artifacts:
reports:
dotenv: vars.env
checkFormatting:
stage: check
script:
- 'sbt scalafmtSbtCheck scalafmtCheckAll'
witboost.helm.checks:
stage: check
extends: .witboost.helm.base-job
before_script: []
cache: []
script:
- !reference [.witboost.helm.clone-scripts, script]
- !reference [.witboost.helm.checks, script]
variables:
CHART_FOLDER: helm
test:
stage: test
script:
- apt-get update -yqq && apt-get install -yqq npm
- npm install @openapitools/[email protected] -g
- 'sbt clean generateCode coverage test coverageReport'
coverage: '/Statement coverage[A-Za-z\.*]\s*:\s*([^%]+)/'
artifacts:
paths:
- target/scala-2.13/scoverage-report/*
- target/scala-2.13/coverage-report/*
reports:
coverage_report:
coverage_format: cobertura
path: 'target/scala-2.13/coverage-report/cobertura.xml'
build:
services:
- docker:24.0.5-dind
stage: build
variables:
DOCKER_HOST: tcp://docker:2375
script: |
apt-get update -yqq && apt-get install -yqq ca-certificates curl gnupg npm
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -yqq && apt-get install -yqq docker-ce-cli
npm install @openapitools/[email protected] -g
echo $VERSION
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
sbt clean generateCode compile k8tyGitlabCIPublish docker:publish
witboost.helm.deploy:
stage: package
before_script: []
cache: []
extends: .witboost.helm.deploy
only:
- master
- tags
- /(^release\/([0-9]+)\.([0-9]+))/