aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2018-11-01 19:08:44 +0100
committerMartin Stockhammer <martin_s@apache.org>2018-11-03 15:54:31 +0100
commitd8b6d1ce007971e3a3674fd4ce423ae5855881ec (patch)
tree03219e1c1ac7223ffcff4e98a0f4b49bbfa47a51
parent88c991837adf37905c031ef75187f345f9998245 (diff)
downloadarchiva-d8b6d1ce007971e3a3674fd4ce423ae5855881ec.tar.gz
archiva-d8b6d1ce007971e3a3674fd4ce423ae5855881ec.zip
Changing ci pipeline settings
Better isolation of workspaces and repositories
-rw-r--r--Jenkinsfile52
-rw-r--r--Jenkinsfile-itest10
2 files changed, 41 insertions, 21 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index fb57b4ddf..6f132c99e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -33,6 +33,7 @@ buildJdk9 = 'JDK 1.9 (latest)'
buildJdk10 = 'JDK 10 (latest)'
buildMvn = 'Maven 3.5.2'
deploySettings = 'archiva-uid-jenkins'
+localRepository = "../.archiva-master-repository"
INTEGRATION_PIPELINE = "Archiva-IntegrationTests-Gitbox"
@@ -40,22 +41,39 @@ pipeline {
agent {
label "${LABEL}"
}
-
+ options {
+ disableConcurrentBuilds()
+ }
+ parameters {
+ booleanParam(name: 'PRECLEANUP', defaultValue: false, description: 'Clears the local maven repository before build.')
+ }
stages {
+ stage('PreCleanup') {
+ when {
+ expression {
+ params.PRECLEANUP
+ }
+ }
+ steps {
+ sh "rm -rf ${localRepository}"
+ }
+ }
+
stage('BuildAndDeploy') {
environment {
- ARCHIVA_USER_CONFIG_FILE='/tmp/archiva-master-jdk-8-${env.JOB_NAME}.xml'
+ ARCHIVA_USER_CONFIG_FILE = '/tmp/archiva-master-jdk-8-${env.JOB_NAME}.xml'
}
+
steps {
timeout(120) {
withMaven(maven: buildMvn, jdk: buildJdk,
mavenSettingsConfig: deploySettings,
- mavenLocalRepo: ".repository",
+ mavenLocalRepo: localRepository,
options: [concordionPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true),
- findbugsPublisher(disabled: true), artifactsPublisher(disabled: false),
+ findbugsPublisher(disabled: true), artifactsPublisher(disabled: true),
invokerPublisher(disabled: true), jgivenPublisher(disabled: true),
junitPublisher(disabled: false, ignoreAttachments: false),
openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]
@@ -75,7 +93,7 @@ pipeline {
// -Dmaven.compiler.fork=true: Do compile in a separate forked process
// -Dmaven.test.failure.ignore=true: Do not stop, if some tests fail
// -Pci-build: Profile for CI-Server
- sh "mvn clean deploy -B -U -e -fae -T1C -Dmaven.compiler.fork=true -Pci-build"
+ sh "mvn clean deploy -B -U -e -fae -Dmaven.compiler.fork=true -Pci-build"
}
}
}
@@ -86,7 +104,6 @@ pipeline {
}
success {
archiveArtifacts '**/target/*.war,**/target/*-bin.zip'
- stash(name:'archiva-master-build-ws')
}
failure {
notifyBuild("Failure in BuildAndDeploy stage")
@@ -100,16 +117,16 @@ pipeline {
parallel {
stage('IntegrationTest') {
steps {
- build(job: "${INTEGRATION_PIPELINE}/archiva/${env.BRANCH_NAME}", propagate: false, quietPeriod: 10)
+ build(job: "${INTEGRATION_PIPELINE}/archiva/${env.BRANCH_NAME}", propagate: false, quietPeriod: 5, wait: false)
}
}
stage('JDK9') {
environment {
- ARCHIVA_USER_CONFIG_FILE='/tmp/archiva-master-jdk-9-${env.JOB_NAME}.xml'
+ ARCHIVA_USER_CONFIG_FILE = '/tmp/archiva-master-jdk-9-${env.JOB_NAME}.xml'
}
steps {
ws("${env.JOB_NAME}-JDK9") {
- unstash(name:'archiva-master-build-ws')
+ checkout scm
timeout(120) {
withMaven(maven: buildMvn, jdk: buildJdk9,
mavenSettingsConfig: deploySettings,
@@ -121,7 +138,7 @@ pipeline {
openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]
)
{
- sh "mvn clean install -B -e -fae -T1C -Dmaven.compiler.fork=true -Pci-build"
+ sh "mvn clean install -U -B -e -fae -Dmaven.compiler.fork=true -Pci-build"
}
}
}
@@ -130,15 +147,18 @@ pipeline {
always {
sh "rm -f /tmp/archiva-master-jdk-9-${env.JOB_NAME}.xml"
}
+ success {
+ cleanWs deleteDirs: true, notFailBuild: true, patterns: [[pattern: '.repository', type: 'EXCLUDE']]
+ }
}
}
stage('JDK10') {
environment {
- ARCHIVA_USER_CONFIG_FILE='/tmp/archiva-master-jdk-10-${env.JOB_NAME}.xml'
+ ARCHIVA_USER_CONFIG_FILE = '/tmp/archiva-master-jdk-10-${env.JOB_NAME}.xml'
}
steps {
ws("${env.JOB_NAME}-JDK10") {
- unstash(name:'archiva-master-build-ws')
+ checkout scm
timeout(120) {
withMaven(maven: buildMvn, jdk: buildJdk10,
mavenSettingsConfig: deploySettings,
@@ -150,7 +170,7 @@ pipeline {
openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]
)
{
- sh "mvn clean install -B -e -fae -T1C -Dmaven.compiler.fork=true -Pci-build"
+ sh "mvn clean install -U -B -e -fae -Dmaven.compiler.fork=true -Pci-build"
}
}
}
@@ -159,6 +179,9 @@ pipeline {
always {
sh "rm -f /tmp/archiva-master-jdk-10-${env.JOB_NAME}.xml"
}
+ success {
+ cleanWs deleteDirs: true, notFailBuild: true, patterns: [[pattern: '.repository', type: 'EXCLUDE']]
+ }
}
}
}
@@ -178,9 +201,6 @@ pipeline {
}
}
}
- always {
- cleanWs()
- }
}
}
diff --git a/Jenkinsfile-itest b/Jenkinsfile-itest
index 075741432..9a45ea47a 100644
--- a/Jenkinsfile-itest
+++ b/Jenkinsfile-itest
@@ -29,6 +29,7 @@ buildJdk = 'JDK 1.8 (latest)'
buildMvn = 'Maven 3.5.2'
deploySettings = 'archiva-uid-jenkins'
DOCKERHUB_CREDS = '10a5f89e-504b-11e8-945d-7fd7b29cc41c'
+localRepository = "../.archiva-master-repository"
pipeline {
agent {
@@ -57,7 +58,7 @@ pipeline {
timeout(120) {
withMaven(maven: buildMvn, jdk: buildJdk,
mavenSettingsConfig: deploySettings,
- mavenLocalRepo: ".repository",
+ mavenLocalRepo: localRepository,
options: [concordionPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true),
findbugsPublisher(disabled: true), artifactsPublisher(disabled: true),
invokerPublisher(disabled: true), jgivenPublisher(disabled: true),
@@ -79,8 +80,7 @@ pipeline {
// -Dmaven.compiler.fork=true: Compile in a separate forked process
// -Pci-server: Profile for CI-Server
// -Pit-js: Run the selenium test
- sh "mvn clean install -B -U -Dmaven.test.skip=true -T2"
- sh "mvn clean install -B -V -U -e -fae -Dmaven.compiler.fork=true -DmaxWaitTimeInMs=2000 -Pci-server -Pit-js -DtrimStackTrace=false -Djava.io.tmpdir=.tmp -pl :archiva-webapp-test"
+ sh "mvn clean verify -B -V -U -e -fae -Dmaven.compiler.fork=true -DmaxWaitTimeInMs=2000 -Pci-server -Pit-js -DtrimStackTrace=false -Djava.io.tmpdir=.tmp -pl :archiva-webapp-test"
}
}
@@ -104,7 +104,7 @@ pipeline {
usernameVariable: 'DOCKER_HUB_USER', passwordVariable: 'DOCKER_HUB_PW']]) {
withMaven(maven: buildMvn, jdk: buildJdk,
mavenSettingsConfig: deploySettings,
- mavenLocalRepo: ".repository",
+ mavenLocalRepo: localRepository,
options: [concordionPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true),
findbugsPublisher(disabled: true), artifactsPublisher(disabled: true),
invokerPublisher(disabled: true), jgivenPublisher(disabled: true),
@@ -128,7 +128,7 @@ pipeline {
// -Pci-server: Profile for CI Server
// -Pit-js: Runs the Selenium tests
// -Pchrome: Activates the Selenium Chrome Test Agent
- sh "mvn clean install -B -V -U -e -fae -Dmaven.compiler.fork=true -DmaxWaitTimeInMs=2000 -DseleniumRemote=true -Pci-server -Pit-js -Pchrome -pl :archiva-webapp-test -DtrimStackTrace=false"
+ sh "mvn verify -B -V -e -fae -Dmaven.compiler.fork=true -DmaxWaitTimeInMs=2000 -DseleniumRemote=true -Pci-server -Pit-js -Pchrome -pl :archiva-webapp-test -DtrimStackTrace=false"
}
}
}