Skip to content

Commit 0abe9ee

Browse files
committed
CAMEL-11930: enable configuration override via ...
...environment variables It could be easier to set environment variables in the job configuration to configure the pipeline job. With this Jenkins node name/label selector can be specified in `AGENT_LABEL`, likewise `JDK_NAME` is the name of JDK installation in Jenkins and additionally `LOCAL_REPOSITORY` environment variable can point to a local repository that the artifacts are installed to.
1 parent a36cd32 commit 0abe9ee

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Jenkinsfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@
1717
* under the License.
1818
*/
1919

20-
def MAVEN_PARAMS = '-U -B -e -fae -V -Dmaven.repo.local=/home/jenkins/jenkins-slave/maven-repositories/0 -Dmaven.compiler.fork=true -Dsurefire.rerunFailingTestsCount=2'
20+
def LOCAL_REPOSITORY = env.LOCAL_REPOSITORY ?: '/home/jenkins/jenkins-slave/maven-repositories/0'
21+
def AGENT_LABEL = env.AGENT_LABEL ?: 'ubuntu'
22+
def JDK_NAME = env.JDK_NAME ?: 'JDK 1.8 (latest)'
23+
24+
def MAVEN_PARAMS = "-U -B -e -fae -V -Dmaven.repo.local=${LOCAL_REPOSITORY} -Dmaven.compiler.fork=true -Dsurefire.rerunFailingTestsCount=2"
2125

2226
pipeline {
2327

2428
agent {
25-
label 'ubuntu'
29+
label AGENT_LABEL
2630
}
2731

2832
tools {
29-
jdk 'JDK 1.8 (latest)'
33+
jdk JDK_NAME
3034
}
3135

3236
options {

0 commit comments

Comments
 (0)