forked from openxal/openxal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
108 lines (96 loc) · 3.29 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
variables:
GIT_SSL_NO_VERIFY: "true"
MAVEN_CLI_OPTS: "-s $CI_PROJECT_DIR/.m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
.maven: &maven
image: registry.esss.lu.se/ics-docker/maven:openjdk-11
only:
- /^site.ess.*$/
tags:
- docker
build.maven:
<<: *maven
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS -DskipTests -Dmaven.javadoc.skip=true clean install'
artifacts:
paths:
- .m2/repository/org/xal/
- "*/target/*.jar"
- "*/*/target/*.jar"
- "*/target/classes"
- "*/*/target/classes"
- "*/*/*/target/classes"
- "*/target/test-classes"
- "*/*/target/test-classes"
- "*/*/*/target/test-classes"
- "dist/target/*.tar.gz"
.maventest: &maventest
<<: *maven
stage: test
script:
- 'cd $SUBDIR'
- 'mvn $MAVEN_CLI_OPTS verify -Dmaven.javadoc.skip=true -fn | tee std.out'
- '! grep "Build failures were ignored" std.out'
artifacts:
paths:
- "$SUBDIR/target/surefire-reports/TEST-*.xml"
- "$SUBDIR/*/target/surefire-reports/TEST-*.xml"
- "$SUBDIR/target/jacoco.exec"
- "$SUBDIR/*/target/jacoco.exec"
reports:
junit:
- "$SUBDIR/target/surefire-reports/TEST-*.xml"
- "$SUBDIR/*/target/surefire-reports/TEST-*.xml"
test.maven.core:
<<: *maventest
variables:
SUBDIR: 'test'
test.maven.extensions:
<<: *maventest
variables:
SUBDIR: 'extensions'
test.maven.plugins:
<<: *maventest
variables:
SUBDIR: 'plugins'
sonarqube.maven:
<<: *maven
stage: deploy
script:
- 'mvn $MAVEN_CLI_OPTS -Dsonar.login=$SONARQUBE_TOKEN -Dsonar.branch.name=$CI_COMMIT_REF_NAME -Dsonar.junit.reportPaths=target/surefire-reports -Dsonar.jacoco.reportPaths="target/jacoco.exec, ../test/target/jacoco.exec" sonar:sonar'
only:
- branches@ess-crs/openxal
publish.maven:
<<: *maven
stage: deploy
script:
- 'mvn $MAVEN_CLI_OPTS deploy -DskipTests -Dmaven.javadoc.skip=true -Dartifactory.username=${ARTIFACTORY_USERNAME} -Dartifactory.password=${ARTIFACTORY_PASSWORD}'
only:
- site.ess.stable@ess-crs/openxal
- site.ess.master@ess-crs/openxal
publish.artifactory:
<<: *maven
stage: deploy
script:
- 'VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)'
- 'if [[ $VERSION == *"SNAPSHOT" ]]; then REPO="snapshot"; else REPO="release"; fi'
- 'cd dist/target'
- 'TARBALL=$(find * -name "*.tar.gz")'
- 'curl -u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} -X PUT "${ARTIFACTORY_URL}/OpenXAL/$REPO/org/xal/openxal.dist/$VERSION/$TARBALL" -T $TARBALL'
only:
- site.ess.stable@ess-crs/openxal
- site.ess.master@ess-crs/openxal
pages:
<<: *maven
script:
- 'mvn $MAVEN_CLI_OPTS javadoc:aggregate'
- 'mvn $MAVEN_CLI_OPTS jacoco:report-aggregate'
- 'mv report/target/site/jacoco-aggregate target/site/apidocs/coverage'
- 'mv target/site/apidocs public'
artifacts:
paths:
- public
only:
- site.ess.stable
- site.ess.master