From 5a287919fa9dbb5d5a44cd725b0b02e5e3d027ff Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 4 Jun 2021 22:27:00 +0200 Subject: Jenkins: lib: only define BASE_DIR and CHANGESET_DIR varibale once --- vars/buildPackage.groovy | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'vars') diff --git a/vars/buildPackage.groovy b/vars/buildPackage.groovy index 511867a6..ca901481 100644 --- a/vars/buildPackage.groovy +++ b/vars/buildPackage.groovy @@ -37,6 +37,11 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false) { agent { label "ec2_amd64" } + environment { + // get relative directory path to Jenkinsfile + BASE_DIR = getJenkinsfilePath() + CHANGESET_DIR = getChangeSetPath() + } steps { script { // create container name on demand @@ -68,11 +73,6 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false) { reuseNode true } } - environment { - // get relative directory path to Jenkinsfile - BASE_DIR = getJenkinsfilePath() - CHANGESET_DIR = getChangeSetPath() - } steps { script { cloneAndBuild(description, 'amd64', pkgList, buildCmd) @@ -100,11 +100,6 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false) { when { equals expected: true, actual: buildArm } - environment { - // get relative directory path to Jenkinsfile - BASE_DIR = getJenkinsfilePath() - CHANGESET_DIR = getChangeSetPath() - } steps { script { cloneAndBuild(description, 'arm64', pkgList, buildCmd) -- cgit v1.2.3