Adding parameter for threads to jenkins file

This commit is contained in:
Martin Stockhammer 2020-02-10 09:48:07 +01:00
parent a3bc5ee7ff
commit 1e7c84322b
1 changed files with 5 additions and 3 deletions

8
Jenkinsfile vendored
View File

@ -43,7 +43,9 @@ pipeline {
triggers {
upstream(upstreamProjects: 'Archiva-TLP-Gitbox/archiva-parent/archiva-2.x', threshold: hudson.model.Result.SUCCESS)
}
parameters {
string(name: 'THREADS', defaultValue: '1', description: 'Number of threads for the mvn build (-T option). Must be a integer value>0.')
}
options {
disableConcurrentBuilds()
durabilityHint('PERFORMANCE_OPTIMIZED')
@ -57,10 +59,10 @@ pipeline {
script{
if (env.NONAPACHEORG_RUN != 'y' && ( env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'redback-2.6.x' ) )
{
asfStandardBuild.mavenBuild( buildJdk, "clean deploy -U -fae -T3", mavenVersion,
asfStandardBuild.mavenBuild( buildJdk, "clean deploy -U -fae -T${THREADS}", mavenVersion,
defaultPublishers )
} else {
asfStandardBuild.mavenBuild( buildJdk, "clean install -U -fae -T3", mavenVersion,
asfStandardBuild.mavenBuild( buildJdk, "clean install -U -fae -T${THREADS}", mavenVersion,
defaultPublishers )
}
}