diff --git a/pipelines/libs/github/vars/getBuildInfo.groovy b/pipelines/libs/github/vars/getBuildInfo.groovy index d12310c5..9ef1f6ca 100644 --- a/pipelines/libs/github/vars/getBuildInfo.groovy +++ b/pipelines/libs/github/vars/getBuildInfo.groovy @@ -58,9 +58,10 @@ def call(String project, Map info) is_draft = false } } else { + info['target'] = env.BRANCH_NAME info['pull_id'] = 1 - info['publishrpm'] = 1 + info['publishrpm'] = isThisAPublishBranch(info['target']) info['install'] = isThisAnInstallBranch(info['target']) if ("${info['install']}" == '1') { if ("${info['target']}" == 'main') { @@ -71,7 +72,7 @@ def call(String project, Map info) info['stableinstall'] = 1 } } - info['covinstall'] = 1 + info['covinstall'] = isThisAPublishBranch(info['target']) } info['is_draft'] = is_draft info['covopts'] = getCovOpts(info['target']) diff --git a/pipelines/libs/gitlab/vars/getBuildInfo.groovy b/pipelines/libs/gitlab/vars/getBuildInfo.groovy index 997c074b..871c1fd1 100644 --- a/pipelines/libs/gitlab/vars/getBuildInfo.groovy +++ b/pipelines/libs/gitlab/vars/getBuildInfo.groovy @@ -61,7 +61,7 @@ def call(String project, Map info) info['target'] = env.BRANCH_NAME info['source'] = env.BRANCH_NAME info['pull_id'] = 1 - info['publishrpm'] = 1 + info['publishrpm'] = isThisAPublishBranch(info['target']) info['install'] = isThisAnInstallBranch(info['target']) if ("${info['install']}" == '1') { if ("${info['target']}" == 'main') { diff --git a/pipelines/libs/global/vars/isThisAPublishBranch.groovy b/pipelines/libs/global/vars/isThisAPublishBranch.groovy new file mode 100644 index 00000000..61292d4c --- /dev/null +++ b/pipelines/libs/global/vars/isThisAPublishBranch.groovy @@ -0,0 +1,15 @@ +// Returns 1 if this branch and coverity scan results need to be published, 0 if not +// Relies on project-specific function getPublishBranches() +def call(String branch) +{ + def publish_branches = getPublishBranches() + if (publish_branches.contains(branch)) { + println("RPMs and Coverity scan results will be published for the branch ${branch}") + return 1 + } + else { + println("RPMs and Coverity scan results will not be published for the branch ${branch}") + return 0 + } + +} diff --git a/pipelines/libs/global/vars/runStage.groovy b/pipelines/libs/global/vars/runStage.groovy index 2e66b540..9552facb 100644 --- a/pipelines/libs/global/vars/runStage.groovy +++ b/pipelines/libs/global/vars/runStage.groovy @@ -117,7 +117,7 @@ def doRunStage(String agentName, Map info, Map localinfo) } // Run all converted groovy stages first - for (stageinfo in stages) { + stages.each { stageinfo -> if (running) { // break does weird shit stagestate['runstage'] = stageinfo.key @@ -145,11 +145,12 @@ def doRunStage(String agentName, Map info, Map localinfo) } } + // Convert localinfo map into shell variables def exports = getShellVariables(localinfo) // Run all the shell stages (will disappear) - for (stageinfo in shell_stages) { + shell_stages.each { stageinfo -> if (running) { // break does weird shit stagestate['runstage'] = stageinfo.key diff --git a/pipelines/projects/anvil/vars/getPublishBranches.groovy b/pipelines/projects/anvil/vars/getPublishBranches.groovy new file mode 100644 index 00000000..37e7c9a4 --- /dev/null +++ b/pipelines/projects/anvil/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main', 'stable-3.1', 'stable-3.2'] +} diff --git a/pipelines/projects/booth/vars/getPublishBranches.groovy b/pipelines/projects/booth/vars/getPublishBranches.groovy new file mode 100644 index 00000000..37e7c9a4 --- /dev/null +++ b/pipelines/projects/booth/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main', 'stable-3.1', 'stable-3.2'] +} diff --git a/pipelines/projects/corosync-qdevice/vars/getPublishBranches.groovy b/pipelines/projects/corosync-qdevice/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/corosync-qdevice/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/corosync/Jenkinsfile b/pipelines/projects/corosync/Jenkinsfile index df9c6159..3946fd9e 100644 --- a/pipelines/projects/corosync/Jenkinsfile +++ b/pipelines/projects/corosync/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { parameters { string(name: 'bootstrap', defaultValue: '0', description: 'Bootstrap the RPM repos') string(name: 'fullrebuild', defaultValue: '0', description: 'This is a full rebuild - do not publish RPM and do NOT update build code on the nodes') - } + } stages { // First check we are allowed to run, then set some params for that run diff --git a/pipelines/projects/corosync/vars/getPublishBranches.groovy b/pipelines/projects/corosync/vars/getPublishBranches.groovy new file mode 100644 index 00000000..0d6f945a --- /dev/null +++ b/pipelines/projects/corosync/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main', 'camelback'] +} diff --git a/pipelines/projects/dlm/vars/getPublishBranches.groovy b/pipelines/projects/dlm/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/dlm/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/fence-agents/vars/getPublishBranches.groovy b/pipelines/projects/fence-agents/vars/getPublishBranches.groovy new file mode 100644 index 00000000..87f6415c --- /dev/null +++ b/pipelines/projects/fence-agents/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches to be installed +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/gfs2-utils/Jenkinsfile b/pipelines/projects/gfs2-utils/Jenkinsfile index 1165dc64..a1e4e649 100644 --- a/pipelines/projects/gfs2-utils/Jenkinsfile +++ b/pipelines/projects/gfs2-utils/Jenkinsfile @@ -21,7 +21,7 @@ pipeline { parameters { string(name: 'bootstrap', defaultValue: '0', description: 'Bootstrap the RPM repos') string(name: 'fullrebuild', defaultValue: '0', description: 'This is a full rebuild - do not publish RPM and do NOT update build code on the nodes') - } + } stages { // First check we are allowed to run, then set some params for that run diff --git a/pipelines/projects/gfs2-utils/vars/getPublishBranches.groovy b/pipelines/projects/gfs2-utils/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/gfs2-utils/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/kernel-ark/vars/getPublishBranches.groovy b/pipelines/projects/kernel-ark/vars/getPublishBranches.groovy new file mode 100644 index 00000000..76185a21 --- /dev/null +++ b/pipelines/projects/kernel-ark/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['ark-latest', 'for-next', 'next'] +} diff --git a/pipelines/projects/knet-ci-test-github/vars/getPublishBranches.groovy b/pipelines/projects/knet-ci-test-github/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/knet-ci-test-github/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/knet-ci-test-gitlab/vars/getPublishBranches.groovy b/pipelines/projects/knet-ci-test-gitlab/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/knet-ci-test-gitlab/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/kronosnet/Jenkinsfile b/pipelines/projects/kronosnet/Jenkinsfile index 5dc08736..ed173c34 100644 --- a/pipelines/projects/kronosnet/Jenkinsfile +++ b/pipelines/projects/kronosnet/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { parameters { string(name: 'bootstrap', defaultValue: '0', description: 'Bootstrap the RPM repos') string(name: 'fullrebuild', defaultValue: '0', description: 'This is a full rebuild - do not publish RPM and do NOT update build code on the nodes') - } + } stages { // First check we are allowed to run, then set some params for that run diff --git a/pipelines/projects/kronosnet/vars/getPublishBranches.groovy b/pipelines/projects/kronosnet/vars/getPublishBranches.groovy new file mode 100644 index 00000000..ef782355 --- /dev/null +++ b/pipelines/projects/kronosnet/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main', 'stable1', 'stable1-proposed'] +} diff --git a/pipelines/projects/kubesan/vars/getPublishBranches.groovy b/pipelines/projects/kubesan/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/kubesan/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/libqb/vars/getPublishBranches.groovy b/pipelines/projects/libqb/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/libqb/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/pacemaker/vars/getPublishBranches.groovy b/pipelines/projects/pacemaker/vars/getPublishBranches.groovy new file mode 100644 index 00000000..cf636d86 --- /dev/null +++ b/pipelines/projects/pacemaker/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main', '3.0', '2.1'] +} diff --git a/pipelines/projects/pcs/vars/getPublishBranches.groovy b/pipelines/projects/pcs/vars/getPublishBranches.groovy new file mode 100644 index 00000000..fadbe1c1 --- /dev/null +++ b/pipelines/projects/pcs/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main', 'pcs-0.10', 'pcs-0.11'] +} diff --git a/pipelines/projects/resource-agents/vars/getPublishBranches.groovy b/pipelines/projects/resource-agents/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/resource-agents/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +} diff --git a/pipelines/projects/sbd/vars/getPublishBranches.groovy b/pipelines/projects/sbd/vars/getPublishBranches.groovy new file mode 100644 index 00000000..8d527041 --- /dev/null +++ b/pipelines/projects/sbd/vars/getPublishBranches.groovy @@ -0,0 +1,5 @@ +// Return list of branches, which will have their RPMs and Coverity scan results published +def call() +{ + return ['main'] +}