-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
79 lines (68 loc) · 1.73 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
image: gradle:7.4
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stages:
- build
- test
- checkstyle
- deploy
- release
build:
stage: build
script:
- gradle assemble
test:
stage: test
script:
- echo "running unit tests..."
- gradle test
- gradle jacocoTestCoverageVerification --info
- gradle testCodeCoverageReport
- cat $CI_PROJECT_DIR/build/reports/jacoco/testCodeCoverageReport/html/index.html | grep -o 'Total[^%]*%'
coverage: '/Total.*?([0-9]{1,3})%/'
artifacts:
paths:
- $CI_PROJECT_DIR/api/build/reports/*
- $CI_PROJECT_DIR/domain/build/reports/*
checkstyle:
stage: checkstyle
script:
- gradle check
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/api/build/reports/*
- $CI_PROJECT_DIR/domain/build/reports/*
deploy:
stage: deploy
rules:
- if: $CI_COMMIT_TAG
script:
- gradle -Pversion=$CI_COMMIT_TAG distZip
- echo RE_JOB_ID=$CI_JOB_ID >> distribute-job.env
artifacts:
paths:
- $CI_PROJECT_DIR/api/build/distributions/*
reports:
dotenv: distribute-job.env
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: deploy
artifacts: true
rules:
- if: $CI_COMMIT_TAG
script:
- echo 'Running release...'
release:
name: 'Release $CI_COMMIT_TAG'
description: 'Created using the release cli'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
assets:
links:
- name: 'Api zip'
url: 'https://git.sogyo.nl/eklemann/mancala-java-esra/-/jobs/${RE_JOB_ID}/artifacts/file/api/build/distributions/api-$CI_COMMIT_TAG.zip'