From ed6e997a1a29fe8d83bef37ca3b38c420198c27d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 30 Jun 2020 15:54:51 +0100 Subject: [PATCH] Reset the branch to remove some SOM variant stuff that came from master --- meta/folder.groovy | 2 +- publish/package.groovy | 15 ++++++++++++++- publish/promptingpublish.groovy | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f600155..aac8b6c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -191,7 +191,7 @@ class BuildStampInfo extends GISJsonSerialised { changerevision(revision) } - void set(String buildstampprefix, String revision) { + void set(String buildstampprefix, String revision = '0') { set(buildstampprefix, revision.toInteger()) } diff --git a/publish/package.groovy b/publish/package.groovy index 2d5fdcc..3bd9565 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -115,6 +115,19 @@ pipeline { FULL_SNAPSHOT_NAME = "${REPO_NAME}_${SNAPSHOT_NAME}" PACKAGE_VERSION_PREFIX = packagemeta.buildstampinfo.buildstampprefix echo "Full Snapshot name is ${FULL_SNAPSHOT_NAME} containing packages of versions beginning with: ${PACKAGE_VERSION_PREFIX}" + // Convert prefix to regular expression + PACKAGE_VERSION_PREFIX_SPLIT = PACKAGE_VERSION_PREFIX.split("[.]") + PACKAGE_VERSION_REGEX = '' + i = 0 + while(true) { + if (i == PACKAGE_VERSION_PREFIX_SPLIT.size() - 1) { + PACKAGE_VERSION_REGEX += PACKAGE_VERSION_PREFIX_SPLIT[i] + break; + } + PACKAGE_VERSION_REGEX += PACKAGE_VERSION_PREFIX_SPLIT[i] + PACKAGE_VERSION_REGEX += '\\.' + i++ + } sh """#!/bin/bash -v # This errors if the snapshot exists already; Ignore it aptly snapshot -config="${APTLY_CONFIG_FILE}" drop "${FULL_SNAPSHOT_NAME}" @@ -122,7 +135,7 @@ pipeline { aptly snapshot -config="${APTLY_CONFIG_FILE}" create "All_${FULL_SNAPSHOT_NAME}" from repo "${REPO_NAME}" if [ \$? -ne 0 ]; then exit 1; fi - aptly snapshot filter -config="/home/repos/gis-aptly-config/gis.conf" "All_${FULL_SNAPSHOT_NAME}" "${FULL_SNAPSHOT_NAME}" 'Version (~ .*${PACKAGE_VERSION_PREFIX}.*)' + aptly snapshot filter -config="/home/repos/gis-aptly-config/gis.conf" "All_${FULL_SNAPSHOT_NAME}" "${FULL_SNAPSHOT_NAME}" 'Version (~ .*${PACKAGE_VERSION_REGEX}.*)' if [ \$? -ne 0 ]; then exit 1; fi aptly snapshot -config="${APTLY_CONFIG_FILE}" -with-packages show "${FULL_SNAPSHOT_NAME}" if [ \$? -ne 0 ]; then exit 1; fi diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index 9f2d7dc..4af0d62 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -66,10 +66,10 @@ pipeline { !release.toLowerCase().startsWith("faulty") && !release.toLowerCase().startsWith("ignore") && !release.toLowerCase().startsWith("inmainline")) { - //echo("Showing release: ${release}") + echo("Showing release: ${release}") releases.add(release) } else { - //echo("Not showing release: ${release}") + echo("Not showing release: ${release}") } } }