diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-21 12:29:39 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-21 12:29:39 +0200 |
commit | 4d11e8b33dfc545d9dab03efcb6fba8e4140f2a9 (patch) | |
tree | e24f9feb181cf1c39989dcfc83e63d09a98259e5 | |
parent | 718cc0ea22923c531cf66f531714af2999cfa776 (diff) | |
download | vyos-build-4d11e8b33dfc545d9dab03efcb6fba8e4140f2a9.tar.gz vyos-build-4d11e8b33dfc545d9dab03efcb6fba8e4140f2a9.zip |
Jenkins: do not run ISO build when pipeline library changes
-rw-r--r-- | Jenkinsfile | 19 | ||||
-rw-r--r-- | vars/buildPackage.groovy | 3 |
2 files changed, 16 insertions, 6 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index dffc6e23..19227442 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -169,14 +169,20 @@ pipeline { beforeOptions true beforeAgent true anyOf { - // Do not build full ISO build when Docker container changes - not { changeset "**/docker/*" } + // Do not run ISO build when the Docker container definition or + // the build pipeline library changes as this has no direct impact + // on the ISO image. + not { + changeset "**/docker/*" + changeset "**/vars/*" + } triggeredBy 'TimerTrigger' triggeredBy cause: "UserIdCause" } } steps { script { + // Display Git commit Id used with the Jenkinsfile on the Job "Build History" pane def commitId = sh(returnStdout: true, script: 'git rev-parse --short=11 HEAD').trim() currentBuild.description = sprintf('Git SHA1: %s', commitId[-11..-1]) @@ -196,8 +202,13 @@ pipeline { beforeOptions true beforeAgent true anyOf { - // Do not build full ISO build when Docker container changes - not { changeset "**/docker/*" } + // Do not run ISO build when the Docker container definition or + // the build pipeline library changes as this has no direct impact + // on the ISO image. + not { + changeset "**/docker/*" + changeset "**/vars/*" + } triggeredBy 'TimerTrigger' triggeredBy cause: "UserIdCause" } diff --git a/vars/buildPackage.groovy b/vars/buildPackage.groovy index 366b1b72..3d51fde3 100644 --- a/vars/buildPackage.groovy +++ b/vars/buildPackage.groovy @@ -87,8 +87,7 @@ def call(description=null, pkgList=null, buildCmd=null) { // checkout git repository which hold 'Jenkinsfile' checkout scm - // Display Git commit Id used on Jenkinsfile on the - // Jenkins Job "Build History" pane + // Display Git commit Id used with the Jenkinsfile on the Job "Build History" pane def commitId = sh(returnStdout: true, script: 'git rev-parse --short=11 HEAD').trim() currentBuild.description = sprintf('Git SHA1: %s', commitId[-11..-1]) |