-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
84 lines (78 loc) · 2.63 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
# include job templates
include:
- project: 'integrator1/devops/gitlab-ci-jobs'
ref: master
file: 'common/test-gradle.gitlab-ci.yml'
- project: 'integrator1/devops/gitlab-ci-jobs'
ref: master
file: 'common/deploy-argocd.gitlab-ci.yml'
- project: 'integrator1/devops/gitlab-ci-jobs'
ref: master
file: 'common/sonarqube.gitlab-ci.yml'
- project: 'integrator1/devops/gitlab-ci-jobs'
ref: master
file: 'common/build-gradle.gitlab-ci.yml'
stages:
- tests
- quality
.artifacts_template: &artifacts
artifacts:
expire_in: 1 week
name: "${CI_COMMIT_SHORT_SHA}_${CI_JOB_ID}"
reports:
junit: "**/test-results/test/*.xml"
paths:
- "**/build/reports/detekt/detekt.xml"
- "**/test-results/test/*.xml"
- "**/build/jacocoReports/test/jacocoTestReport.xml"
- images.json
- "**/build/libs"
# check code quality
code_quality:
extends:
- .check_code_quality
only:
- master
- dev
- merge_requests
- /^.*rc.*$/
- /^.*release.*$/
- /^.*hotfix.*$/
tests&build:
image: $CI_REGISTRY/integrator/devops/openjdk-17-slim-docker:d837de0d
extends:
- .test-gradle
script:
- ./gradlew -PweMavenUser=$MAVEN_USER -PweMavenPassword=$MAVEN_PASSWORD version check build publish
only:
- dev
- /^.*rc.*$/
- /^.*release.*$/
- /^.*hotfix.*$/
<<: *artifacts
tests&build_for_maven_central:
image: $CI_REGISTRY/integrator/devops/openjdk-17-slim-docker:d837de0d
extends:
- .test-gradle
script:
- cat $we_maven_central_gpg | base64 --decode > "$(pwd)/we_maven_central.gpg"
- ./gradlew --no-parallel -PsonaTypeMavenUser=$SONATYPE_USER -PsonaTypeMavenPassword=$SONATYPE_PASSWORD -Psigning.keyId=$SIGN_KEY_ID -Psigning.password=$SIGN_PASSWORD -Psigning.secretKeyRingFile="$(pwd)/we_maven_central.gpg" version check build publish
- ./gradlew -PsonaTypeMavenUser=$SONATYPE_USER -PsonaTypeMavenPassword=$SONATYPE_PASSWORD closeAndReleaseStagingRepository
only:
- master
<<: *artifacts
tests-mr:
image: $CI_REGISTRY/integrator/devops/openjdk-17-slim-docker:d837de0d
extends:
- .test-mr-gradle
script:
- git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
- git config user.email "[email protected]"
- git config user.name "GitLab CI WeIntegrator"
- git checkout $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- git pull
- git merge origin/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
- ./gradlew -PweMavenUser=$MAVEN_USER -PweMavenPassword=$MAVEN_PASSWORD check build
- docker images --format "{{json . }}" --no-trunc > images.json
<<: *artifacts