HMBXR5601-827 - Filter one branches packages from another

This commit is contained in:
Dan Hawkins 2019-09-12 09:27:44 +01:00
commit c50f45705d

View file

@ -113,11 +113,16 @@ pipeline {
script {
echo "Snapshot name is ${SNAPSHOT_NAME}"
FULL_SNAPSHOT_NAME = "${REPO_NAME}_${SNAPSHOT_NAME}"
echo "Full Snapshot name is ${FULL_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}"
sh """#!/bin/bash -v
# This errors if the snapshot exists already; Ignore it
aptly snapshot -config="${APTLY_CONFIG_FILE}" drop "All"
aptly snapshot -config="${APTLY_CONFIG_FILE}" create "All" from repo "${REPO_NAME}"
if [ \$? -ne 0 ]; then exit 1; fi
aptly snapshot -config="${APTLY_CONFIG_FILE}" drop "${FULL_SNAPSHOT_NAME}"
aptly snapshot -config="${APTLY_CONFIG_FILE}" create "${FULL_SNAPSHOT_NAME}" from repo "${REPO_NAME}"
aptly snapshot filter -config="/home/repos/gis-aptly-config/gis.conf" "All" ${FULL_SNAPSHOT_NAME}" 'Version (~ .*${PACKAGE_VERSION_PREFIX}.*)'
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