Verified Commit e8e72426 authored by Johannes Visintini's avatar Johannes Visintini
Browse files

Jenkins: update dependency cache when building

parent c1622455
Pipeline #2806 passed with stage
in 0 seconds
...@@ -46,7 +46,7 @@ pipeline { ...@@ -46,7 +46,7 @@ pipeline {
rtMaven.deployer.deployArtifacts = false rtMaven.deployer.deployArtifacts = false
withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) {
buildInfo = rtMaven.run pom: 'pom.xml', goals: '--batch-mode clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE' buildInfo = rtMaven.run pom: 'pom.xml', goals: '--batch-mode --update-snapshots clean compile javadoc:jar source:jar verify -P jacoco,sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE'
} }
} }
} }
...@@ -61,7 +61,7 @@ pipeline { ...@@ -61,7 +61,7 @@ pipeline {
steps { steps {
script { script {
withSonarQubeEnv('sonarcloud GIScience/ohsome') { withSonarQubeEnv('sonarcloud GIScience/ohsome') {
sh "mvn --batch-mode sonar:sonar -Dsonar.branch.name=${env.BRANCH_NAME}" sh "mvn --batch-mode --update-snapshots sonar:sonar -Dsonar.branch.name=${env.BRANCH_NAME}"
} }
report_basedir = "/srv/reports/${REPO_NAME}/${VERSION}_${env.BRANCH_NAME}/${env.BUILD_NUMBER}_${LATEST_COMMIT_ID}" report_basedir = "/srv/reports/${REPO_NAME}/${VERSION}_${env.BRANCH_NAME}/${env.BUILD_NUMBER}_${LATEST_COMMIT_ID}"
...@@ -77,7 +77,7 @@ pipeline { ...@@ -77,7 +77,7 @@ pipeline {
sh "mkdir -p ${report_dir} && rm -Rf ${report_dir}* && find . -path '*/target/site/jacoco' -exec cp -R --parents {} ${report_dir} \\; && find ${report_dir} -path '*/target/site/jacoco' | while read line; do echo \$line; neu=\${line/target\\/site\\/jacoco/} ; mv \$line/* \$neu ; done && find ${report_dir} -type d -empty -delete" sh "mkdir -p ${report_dir} && rm -Rf ${report_dir}* && find . -path '*/target/site/jacoco' -exec cp -R --parents {} ${report_dir} \\; && find ${report_dir} -path '*/target/site/jacoco' | while read line; do echo \$line; neu=\${line/target\\/site\\/jacoco/} ; mv \$line/* \$neu ; done && find ${report_dir} -type d -empty -delete"
// warnings plugin // warnings plugin
rtMaven.run pom: 'pom.xml', goals: '--batch-mode -V -e compile checkstyle:checkstyle pmd:pmd pmd:cpd spotbugs:spotbugs -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' rtMaven.run pom: 'pom.xml', goals: '--batch-mode --update-snapshots -V -e compile checkstyle:checkstyle pmd:pmd pmd:cpd spotbugs:spotbugs -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS'
recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()] recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()]
recordIssues enabledForFailure: true, tool: checkStyle() recordIssues enabledForFailure: true, tool: checkStyle()
...@@ -102,7 +102,7 @@ pipeline { ...@@ -102,7 +102,7 @@ pipeline {
steps { steps {
script { script {
withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) {
buildInfo = rtMaven.run pom: 'pom.xml', goals: '--batch-mode clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' buildInfo = rtMaven.run pom: 'pom.xml', goals: '--batch-mode --update-snapshots clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true'
} }
rtMaven.deployer.deployArtifacts buildInfo rtMaven.deployer.deployArtifacts buildInfo
server.publishBuildInfo buildInfo server.publishBuildInfo buildInfo
...@@ -125,7 +125,7 @@ pipeline { ...@@ -125,7 +125,7 @@ pipeline {
steps { steps {
script { script {
withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) { withCredentials([string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')]) {
buildInfo = rtMaven.run pom: 'pom.xml', goals: '--batch-mode clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' buildInfo = rtMaven.run pom: 'pom.xml', goals: '--batch-mode --update-snapshots clean compile javadoc:jar source:jar install -P sign,git -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true'
} }
rtMaven.deployer.deployArtifacts buildInfo rtMaven.deployer.deployArtifacts buildInfo
server.publishBuildInfo buildInfo server.publishBuildInfo buildInfo
...@@ -135,7 +135,7 @@ pipeline { ...@@ -135,7 +135,7 @@ pipeline {
file(credentialsId: 'ossrh-settings', variable: 'settingsFile'), file(credentialsId: 'ossrh-settings', variable: 'settingsFile'),
string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE') string(credentialsId: 'gpg-signing-key-passphrase', variable: 'PASSPHRASE')
]) { ]) {
sh 'mvn --batch-mode clean compile -s $settingsFile javadoc:jar source:jar deploy -P sign,git,deploy-central -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true' sh 'mvn --batch-mode --update-snapshots clean compile -s $settingsFile javadoc:jar source:jar deploy -P sign,git,deploy-central -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS -Dgpg.passphrase=$PASSPHRASE -DskipTests=true'
} }
} }
post { post {
...@@ -155,12 +155,12 @@ pipeline { ...@@ -155,12 +155,12 @@ pipeline {
steps { steps {
script { script {
// load dependencies to artifactory // load dependencies to artifactory
rtMaven.run pom: 'pom.xml', goals: '--batch-mode org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' rtMaven.run pom: 'pom.xml', goals: '--batch-mode --update-snapshots org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS'
javadc_dir = "/srv/javadoc/java/" + REPO_NAME + "/" + VERSION + "/" javadc_dir = "/srv/javadoc/java/" + REPO_NAME + "/" + VERSION + "/"
echo javadc_dir echo javadc_dir
rtMaven.run pom: 'pom.xml', goals: '--batch-mode clean javadoc:javadoc -Dadditionalparam=-Xdoclint:none -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS' rtMaven.run pom: 'pom.xml', goals: '--batch-mode --update-snapshots clean javadoc:javadoc -Dadditionalparam=-Xdoclint:none -Dmaven.repo.local=.m2 $MAVEN_TEST_OPTIONS'
sh "echo ${javadc_dir}" sh "echo ${javadc_dir}"
// make sure jenkins uses bash not dash! // make sure jenkins uses bash not dash!
sh "mkdir -p ${javadc_dir} && rm -Rf ${javadc_dir}* && find . -path '*/target/site/apidocs' -exec cp -R --parents {} ${javadc_dir} \\; && find ${javadc_dir} -path '*/target/site/apidocs' | while read line; do echo \$line; neu=\${line/target\\/site\\/apidocs/} ; mv \$line/* \$neu ; done && find ${javadc_dir} -type d -empty -delete" sh "mkdir -p ${javadc_dir} && rm -Rf ${javadc_dir}* && find . -path '*/target/site/apidocs' -exec cp -R --parents {} ${javadc_dir} \\; && find ${javadc_dir} -path '*/target/site/apidocs' | while read line; do echo \$line; neu=\${line/target\\/site\\/apidocs/} ; mv \$line/* \$neu ; done && find ${javadc_dir} -type d -empty -delete"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment