-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
117 lines (105 loc) · 3.46 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
stages:
- .pre-build
- test
- publish
default:
tags:
- docker
variables:
MAVEN_VERSION: "3.6.3-jdk-11"
MAVEN_CLI_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -U"
MAVEN_CLI_DEPLOY: "-Dmaven_nexus_schema=${CI_MAVEN_NEXUS_SCHEMA} -Dmaven_nexus_host=${CI_MAVEN_NEXUS_HOST} -Dmaven_nexus_port=${CI_MAVEN_NEXUS_PORT} -Dmaven_nexus_docker_registry_hosted=${CI_MAVEN_NEXUS_DOCKER_REGISTRY_HOSTED} -Dmaven_nexus_docker_registry_public=${CI_MAVEN_NEXUS_DOCKER_REGISTRY_PUBLIC}"
cache:
paths:
- .m2/repository
include:
- local: '.gitlab/.gitlab-ci-archetype.yml'
- local: 'auth-server-oracle/.gitlab/.gitlab-ci-test.yml'
- local: 'auth-server-postgres/.gitlab/.gitlab-ci-test.yml'
- local: 'resource-server-oracle/.gitlab/.gitlab-ci-test.yml'
- local: 'resource-server-postgres/.gitlab/.gitlab-ci-test.yml'
maven:deploy:archetype:spring-boot:
stage: .pre-build
image: ${PRIVATE_REGISTRY_PULL}/maven:${MAVEN_VERSION}
script:
- mvn -N -s $M2_PROXY_XML $MAVEN_CLI_OPTS $MAVEN_CLI_DEPLOY deploy -DskipTests
only:
changes:
- pom.xml
- .gitlab-ci.yml
refs:
- master
- main
except:
refs:
- /-release/
- /-final/
## Testing environment
maven:test:archetype:auth-server-postgres:
stage: test
variables:
MAVEN_PROJECT_NAME: auth-server-postgres
extends: .test-junit-auth-postgres
script:
- mvn -pl $MAVEN_PROJECT_NAME -s $M2_PROXY_XML $MAVEN_CLI_OPTS clean jacoco:prepare-agent test jacoco:report
# after_script:
# - mvn -s $M2_SETTINGS_XML sonar:sonar -Dsonar.projectKey=$CI_PROJECT_ID-$CI_DEFAULT_BRANCH -Dsonar.host.url=$URL_SONAR -Dsonar.login=$AUTH_SONAR -Dmaven.test.failure.ignore=false
artifacts:
reports:
junit:
- $MAVEN_PROJECT_NAME/target/surefire-reports/TEST-*.xml
- $MAVEN_PROJECT_NAME/target/failsafe-reports/TEST-*.xml
only:
- /-release/
maven:test:archetype:resource-server-postgres:
stage: test
variables:
MAVEN_PROJECT_NAME: resource-server-postgres
extends: .test-junit-resource-postgres
script:
- mvn -pl $MAVEN_PROJECT_NAME -s $M2_PROXY_XML $MAVEN_CLI_OPTS clean jacoco:prepare-agent test jacoco:report
# after_script:
# - mvn -s $M2_SETTINGS_XML sonar:sonar -Dsonar.projectKey=$CI_PROJECT_ID-$CI_DEFAULT_BRANCH -Dsonar.host.url=$URL_SONAR -Dsonar.login=$AUTH_SONAR -Dmaven.test.failure.ignore=false
artifacts:
reports:
junit:
- $MAVEN_PROJECT_NAME/target/surefire-reports/TEST-*.xml
- $MAVEN_PROJECT_NAME/target/failsafe-reports/TEST-*.xml
only:
- /-release/
## Deploy archetype
maven:deploy:archetype:auth-oracle:
stage: publish
extends: .maven-deploy-archetype-from-project
variables:
MAVEN_PROJECT_NAME: auth-server-oracle
only:
- /-release/
maven:deploy:archetype:resource-oracle:
stage: publish
extends: .maven-deploy-archetype-from-project
variables:
MAVEN_PROJECT_NAME: resource-server-oracle
only:
- /-release/
maven:deploy:archetype:auth-postgres:
stage: publish
extends: .maven-deploy-archetype-from-project
variables:
MAVEN_PROJECT_NAME: auth-server-postgres
only:
- /-release/
maven:deploy:archetype:resource-postgres:
stage: publish
extends: .maven-deploy-archetype-from-project
variables:
MAVEN_PROJECT_NAME: resource-server-postgres
only:
- /-release/
maven:deploy:archetype:resource-s3:
stage: publish
extends: .maven-deploy-archetype-from-project
variables:
MAVEN_PROJECT_NAME: resource-s3
only:
- /-release/