Handle version regex properly
This commit is contained in:
parent
84eb2c5af8
commit
5e9689a858
1 changed files with 15 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue