summaryrefslogtreecommitdiff
path: root/vars/buildPackage.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'vars/buildPackage.groovy')
-rw-r--r--vars/buildPackage.groovy27
1 files changed, 21 insertions, 6 deletions
diff --git a/vars/buildPackage.groovy b/vars/buildPackage.groovy
index 89f9a7d4..344420b8 100644
--- a/vars/buildPackage.groovy
+++ b/vars/buildPackage.groovy
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesPattern="**", buildLabel="ec2_amd64") {
+def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesPattern="**", buildLabel="ec2_amd64", changesPatternComparator="GLOB") {
// - description: Arbitrary text to print on Jenkins Job Description
// instead of package name
// - pkgList: Multiple packages can be build at once in a single Pipeline run
@@ -44,7 +44,7 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesP
}
when {
anyOf {
- changeset "${changesPattern}"
+ changeset pattern: changesPattern, caseSensitive: true, comparator: changesPatternComparator
triggeredBy cause: "UserIdCause"
}
}
@@ -70,7 +70,7 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesP
stage('Build Code') {
when {
anyOf {
- changeset pattern: changesPattern, caseSensitive: true
+ changeset pattern: changesPattern, caseSensitive: true, comparator: changesPatternComparator
triggeredBy cause: "UserIdCause"
}
}
@@ -115,7 +115,13 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesP
}
}
when {
- equals expected: true, actual: buildArm
+ beforeAgent true
+ allOf {
+ expression {
+ return env.ARM64_BUILD_DISABLED != 'true'
+ }
+ equals expected: true, actual: buildArm
+ }
}
steps {
script {
@@ -134,7 +140,7 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesP
stage("Finalize") {
when {
anyOf {
- changeset pattern: changesPattern, caseSensitive: true
+ changeset pattern: changesPattern, caseSensitive: true, comparator: changesPatternComparator
triggeredBy cause: "UserIdCause"
}
}
@@ -245,11 +251,20 @@ def call(description=null, pkgList=null, buildCmd=null, buildArm=false, changesP
def ARCH = ''
if (PACKAGE_ARCH != 'all')
ARCH = '-A ' + PACKAGE_ARCH
+ def EXTRA_ARGS = ''
+ // Add generic Priority if missing
+ if (sh(returnStatus: true, script: "dpkg-deb -f ${FILE} | grep Priority:") != 0) {
+ EXTRA_ARGS = EXTRA_ARGS + ' -P optional'
+ }
+ // Add generic Section if missing
+ if (sh(returnStatus: true, script: "dpkg-deb -f ${FILE} | grep Section:") != 0) {
+ EXTRA_ARGS = EXTRA_ARGS + ' -S misc'
+ }
sh(script: "scp ${SSH_OPTS} ${FILE} ${SSH_REMOTE}:${SSH_DIR}")
// Packages like FRR produce their binary in a nested path e.g. packages/frr/frr-rpki-rtrlib-dbgsym_7.5_arm64.deb,
// thus we will only extract the filename portion from FILE as the binary is scp'ed to SSH_DIR without any subpath.
def FILENAME = FILE.toString().tokenize('/').last()
- sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"uncron-add 'reprepro -v -b ${VYOS_REPO_PATH} ${ARCH} includedeb ${RELEASE} ${SSH_DIR}/${FILENAME}'\"")
+ sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"uncron-add 'reprepro -v -b ${VYOS_REPO_PATH}${EXTRA_ARGS} ${ARCH} includedeb ${RELEASE} ${SSH_DIR}/${FILENAME}'\"")
}
sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"uncron-add 'reprepro -v -b ${VYOS_REPO_PATH} deleteunreferenced'\"")
}