diff --git a/autobuilder.groovy b/autobuilder.groovy index 1256394..ccc32c1 100644 --- a/autobuilder.groovy +++ b/autobuilder.groovy @@ -40,12 +40,14 @@ def startbuild(script, String productname = PRODUCT_NAME, String subcomponentnam conditionalclean() def meta = getmetafolderscript().metareset(script) + echo "Product name: ${productname} Subcomponent name: ${subcomponentname}" meta.productinfo.set(productname, subcomponentname) def now = new Date() now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString()) def rr = load("${commonscripts()}/release/registerrepo.groovy") + echo "Release repo: ${releaserepo}" rr.registerrepo(meta, releaserepo) def ch = load("${commonscripts()}/configuration/configuration.groovy") diff --git a/copy/filtered.groovy b/copy/filtered.groovy new file mode 100644 index 0000000..feaa2ab --- /dev/null +++ b/copy/filtered.groovy @@ -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' + } + } +} diff --git a/release/do.groovy b/release/do.groovy index 817fd5f..3221d25 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -211,9 +211,9 @@ def boolean releasegittag(String postcommitshacode, String tag) { // Check if tag exists already def String existingshacode = releasegitgetshacode(tag) if (existingshacode) { // Tag exists - if (existingshacode != postcommitshacode) { // If the existing tag is not associated with HEAD + if (existingshacode != postcommitshacode) { // If the existing tag is not associated with the one expected // This is a problem - The tag is already at another position in git repo - setunstable("The release tag ${tag} has been used at another commit other than HEAD - You must decide what to do with it - Not good practice to delete it or move it") + setunstable("The release tag ${tag} has been used at another commit other than one expected - You must decide what to do with it - Not good practice to delete it or move it (Existing sha code: ${existingshacode} Post commit sha code: ${postcommitshacode})") summaryappend("(${tag} - Could not add!)") } else { summaryappend("(${tag} - Already added)") @@ -247,7 +247,7 @@ def boolean sourcegittag(String shacode, String tag) { def existingshacode = readFile(file: gitrevparseoutputfile).trim() if (existingshacode != shacode) { // If the existing tag is not associated with HEAD // This is a problem - The tag is already at another position in git repo - setunstable("The source tag ${tag} has been used at another commit (${existingshacode}) - You must decide what to do with it - Not good practice to delete it or move it") + setunstable("The source tag ${tag} has been used at another commit (${existingshacode}) - You must decide what to do with it - Not good practice to delete it or move it (Existing sha code: ${existingshacode} Post commit sha code: ${shacode})") summaryappend("(${tag} - Could not add!)") } else { diff --git a/remoteaccess/ftp.groovy b/remoteaccess/ftp.groovy index bdc441f..25b9143 100644 --- a/remoteaccess/ftp.groovy +++ b/remoteaccess/ftp.groovy @@ -1,4 +1,3 @@ -@Grab(group='commons-net', module='commons-net', version='2.0') import org.apache.commons.net.ftp.FTPClient class FTPSiteInfo { @@ -30,4 +29,4 @@ FTPClient createFTPClient(FTPSiteInfo ftpsiteinfo) { return ftpclient } -return this; \ No newline at end of file +return this;