mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Optimize ci
This commit is contained in:
parent
67d05d2130
commit
59c48f3918
2 changed files with 58 additions and 1 deletions
|
|
@ -2,16 +2,22 @@ image: maven:latest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID "
|
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID "
|
||||||
MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=/cache/repository -Dfile.encoding=UTF-8"
|
MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=repository -Dfile.encoding=UTF-8 -s .settings/settings.xml"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
|
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
|
||||||
|
|
||||||
|
cache:
|
||||||
|
key: maven
|
||||||
|
paths:
|
||||||
|
- repository
|
||||||
|
|
||||||
build-amazoncorretto:
|
build-amazoncorretto:
|
||||||
stage: build
|
stage: build
|
||||||
image: maven:amazoncorretto
|
image: maven:amazoncorretto
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||||
|
retry: 2
|
||||||
artifacts:
|
artifacts:
|
||||||
name: amazoncorretto
|
name: amazoncorretto
|
||||||
paths:
|
paths:
|
||||||
|
|
@ -26,6 +32,7 @@ build-java-14:
|
||||||
image: maven:3-jdk-14
|
image: maven:3-jdk-14
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||||
|
retry: 2
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_failure
|
when: on_failure
|
||||||
name: java-14
|
name: java-14
|
||||||
|
|
@ -41,6 +48,7 @@ build-java-11-openj9:
|
||||||
image: maven:3-jdk-11-openj9
|
image: maven:3-jdk-11-openj9
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||||
|
retry: 2
|
||||||
artifacts:
|
artifacts:
|
||||||
name: java-11-openj9
|
name: java-11-openj9
|
||||||
paths:
|
paths:
|
||||||
|
|
@ -55,6 +63,7 @@ build-java-11:
|
||||||
image: maven:3-jdk-11
|
image: maven:3-jdk-11
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||||
|
retry: 2
|
||||||
artifacts:
|
artifacts:
|
||||||
name: java-11
|
name: java-11
|
||||||
paths:
|
paths:
|
||||||
|
|
@ -70,6 +79,7 @@ build-java-8-openj9:
|
||||||
image: maven:3-jdk-8-openj9
|
image: maven:3-jdk-8-openj9
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||||
|
retry: 2
|
||||||
artifacts:
|
artifacts:
|
||||||
name: java-8-open-j9
|
name: java-8-open-j9
|
||||||
paths:
|
paths:
|
||||||
|
|
@ -84,6 +94,7 @@ build-java8:
|
||||||
image: maven:3-jdk-8-alpine
|
image: maven:3-jdk-8-alpine
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
|
||||||
|
retry: 2
|
||||||
artifacts:
|
artifacts:
|
||||||
name: java-8-alpine
|
name: java-8-alpine
|
||||||
paths:
|
paths:
|
||||||
|
|
@ -92,3 +103,18 @@ build-java8:
|
||||||
junit:
|
junit:
|
||||||
- target/surefire-reports/*.xml
|
- target/surefire-reports/*.xml
|
||||||
- target/failsafe-reports/*.xml
|
- target/failsafe-reports/*.xml
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
stage: deploy
|
||||||
|
image: maven:3-jdk-11
|
||||||
|
dependencies:
|
||||||
|
- build-java-11
|
||||||
|
script:
|
||||||
|
- export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||||
|
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -Dclassifier="distribution" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||||
|
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||||
|
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-javadoc.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="javadoc" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||||
|
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||||
|
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-java8-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="java8-standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||||
|
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="sources" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
|
||||||
|
when: manual
|
||||||
|
|
|
||||||
31
.settings/settings.xml
Normal file
31
.settings/settings.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
|
||||||
|
<!--
|
||||||
|
~ Copyright 2017-2021 Koordinierungsstelle für IT-Standards (KoSIT)
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
<servers>
|
||||||
|
<server>
|
||||||
|
<id>gitlab-maven</id>
|
||||||
|
<configuration>
|
||||||
|
<httpHeaders>
|
||||||
|
<property>
|
||||||
|
<name>Job-Token</name>
|
||||||
|
<value>${env.CI_JOB_TOKEN}</value>
|
||||||
|
</property>
|
||||||
|
</httpHeaders>
|
||||||
|
</configuration>
|
||||||
|
</server>
|
||||||
|
</servers>
|
||||||
|
</settings>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue