From 7515aadc46267c14609a9c12dca7d660373597d7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 10 May 2020 22:03:12 +0100 Subject: [PATCH 1/5] Debug why prompting publish is not filtering --- publish/promptingpublish.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}") } } } From b77403c92f93fcf6f729751cc39b3de5086d2ed3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Jun 2020 11:16:28 +0100 Subject: [PATCH 2/5] Remove redundant parameter --- meta/folder.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index f600155..4e7dc99 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -184,14 +184,14 @@ class BuildStampInfo extends GISJsonSerialised { script.echo("Build stamp now ${buildstamp}") } - void set(String buildstampprefix, int revision) { + void set(String buildstampprefix, int revision = 0) { buildstampprefix += buildstampprefix.endsWith('.') ? '' : '.' this.buildstampprefix = buildstampprefix this.buildstamp = buildstampprefix + "0" changerevision(revision) } - void set(String buildstampprefix, String revision) { + void set(String buildstampprefix, String revision = '0') { set(buildstampprefix, revision.toInteger()) } From 5559b50a78444bf359529bb3418e6d5b23e735e1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 17 Jun 2020 11:19:22 +0100 Subject: [PATCH 3/5] Remove redundant parameter --- meta/folder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 4e7dc99..aac8b6c 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -184,7 +184,7 @@ class BuildStampInfo extends GISJsonSerialised { script.echo("Build stamp now ${buildstamp}") } - void set(String buildstampprefix, int revision = 0) { + void set(String buildstampprefix, int revision) { buildstampprefix += buildstampprefix.endsWith('.') ? '' : '.' this.buildstampprefix = buildstampprefix this.buildstamp = buildstampprefix + "0" From 5e9689a8587ade2bc3957ef706ad900ae217e6eb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 27 Jun 2020 11:49:15 +0100 Subject: [PATCH 4/5] Handle version regex properly --- publish/package.groovy | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/publish/package.groovy b/publish/package.groovy index 2d5fdcc..e81d2c2 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -115,6 +115,20 @@ 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 == list.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 +136,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 From 50cb58a77c5a3468ac3170007e7f49e6a0f1b37b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 27 Jun 2020 20:10:21 +0100 Subject: [PATCH 5/5] CORE-52 - Adding additional resources for controlling remote upgrades - debug --- publish/package.groovy | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/publish/package.groovy b/publish/package.groovy index e81d2c2..3bd9565 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -120,13 +120,12 @@ pipeline { PACKAGE_VERSION_REGEX = '' i = 0 while(true) { - if (i == list.size() - 1) { + 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 += '\\\.' - } + PACKAGE_VERSION_REGEX += PACKAGE_VERSION_PREFIX_SPLIT[i] + PACKAGE_VERSION_REGEX += '\\.' i++ } sh """#!/bin/bash -v