Add filtered copy

This commit is contained in:
Dan Hawkins 2020-02-21 05:52:17 +00:00
commit 44b189c724

70
copy/filtered.groovy Normal file
View file

@ -0,0 +1,70 @@
pipeline {
agent { label AGENT_LABEL }
stages {
stage('Initial setup') {
steps {
script {
meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this)
importer = load("${autobuilder.commonscripts()}/import/importer.groovy")
}
}
}
stage('Clean') {
steps {
script {
env.IMPORT = "${WORKSPACE}/import"
env.FILTEREDDEST = "${WORKSPACE}/filtered"
cleanfolders = [
FILTEREDDEST,
IMPORT,
]
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
cleaner.clean(cleanfolders)
}
}
}
stage('Import artifacts') {
steps {
script {
importer.artifactimport(meta, ARTIFACT_LOCATION, ARTIFACT_PROJECT, ARTIFACT_BUILD_SELECTOR, RELEASE_REPO, RELEASE_REVISION, IMPORT)
}
}
}
stage('Filtered copy') {
steps {
script {
dir(IMPORT) {
fileOperations([
fileCopyOperation(excludes: EXCLUDES,
flattenFiles: FLATTENOUTPUT,
includes: INCLUDES,
targetLocation: FILTEREDDEST)])
}
}
}
}
stage('Archiving artifacts') {
steps {
script {
def artifactlist = meta.generateartifacts(["filtered/**"])
archiveArtifacts "${artifactlist}"
}
}
}
}
post {
always {
echo 'Post-build'
}
failure {
echo 'Failed build'
}
unstable {
echo 'Unstable build'
}
success {
echo 'Succeeded build'
}
}
}