Initial commit

This commit is contained in:
Dan Hawkins 2022-02-13 17:01:43 +00:00
commit 9171d4d093

61
product/foreach.groovy Normal file
View file

@ -0,0 +1,61 @@
def productcollectionstore = null
/* Example expected JSON
{
"ProductReleaseRepos": [
"git@hydra:print-server-releases/print_server_whole.git"
]
}*/
def String asJsonText() {
return writeJSON(returnText: true, json: productcollectionstore, pretty: 1)
}
def boolean exists() {
return (productcollectionstore != null)
}
def set(String jsontext) {
productcollectionstore = readJSON(text: jsontext)
echo "Product collection:\n${asJsonText()}"
}
def get() {
return productcollectionstore
}
pipeline {
agent { label AGENT_LABEL }
stages {
stage('Initial setup') {
steps {
script {
autobuilderscript = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy")
meta = autobuilderscript.startnonbuild(this)
set(PRODUCT_COLLECTION)
}
}
}
stage('Clean folders') {
steps {
script {
cleanfolders = [
]
cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy")
cleaner.clean(cleanfolders)
}
}
}
stage('Iterate product collection') {
steps {
script {
def productcollection = get()
for (productrepo in productcollection.ProductReleaseRepos) {
}
}
}
}
}
}
PRODUCT_COLLECTION