HMBXR5601-827 - Add package publish operations

This commit is contained in:
Dan Hawkins 2019-08-27 15:41:19 +01:00
commit e86106fb26

View file

@ -49,6 +49,7 @@ pipeline {
script {
importer = load("${autobuilder.commonscripts()}/import/importer.groovy")
packagemeta = importer.artifactimport(meta, PACKAGE_CREATE_JOB, PACKAGE_CREATE_JOB_SELECTOR, PACKAGEDEST)
PACKAGE_FOLDER = "${PACKAGEDEST}/package"
}
}
}
@ -78,6 +79,17 @@ pipeline {
}
}
}
stage('Add/update package in snapshot') {
steps {
script {
echo "Package folder is ${PACKAGE_FOLDER}"
sh """#!/bin/bash -v
aptly snapshot -config="${APTLY_CONFIG_FILE}" add -force-replace "${PACKAGE_FOLDER}"
if [ \$? -ne 0 ]; then exit 1; fi
"""
}
}
}
stage('Create snapshot - if not already there') {
steps {
script {
@ -86,8 +98,11 @@ pipeline {
echo "Full Snapshot name is ${FULL_SNAPSHOT_NAME}"
sh """#!/bin/bash -v
# This errors if the snapshot exists already; Ignore it
aptly snapshot -config="${APTLY_CONFIG_FILE}" drop "${FULL_SNAPSHOT_NAME}"
aptly snapshot -config="${APTLY_CONFIG_FILE}" create "${FULL_SNAPSHOT_NAME}" from repo "${REPO_NAME}"
if [ \$? -ne 0 ]; then exit 1; fi
aptly snapshot -config="${APTLY_CONFIG_FILE}" show "${FULL_SNAPSHOT_NAME}"
if [ \$? -ne 0 ]; then exit 1; fi
"""
}
}