diff --git a/publish/package.groovy b/publish/package.groovy index 0f1ad9e..9a77259 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -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