diff --git a/ghaf-main-pipeline.groovy b/ghaf-main-pipeline.groovy index 3b6bb6c..85d949d 100644 --- a/ghaf-main-pipeline.groovy +++ b/ghaf-main-pipeline.groovy @@ -15,6 +15,11 @@ properties([ githubProjectProperty(displayName: '', projectUrlStr: REPO_URL), ]) +def run_type_description = ''' +normal - executing all configured build and test stages normally
+setup - only reloading configuration, not running futher stages +''' + // Record failed target(s) def failedTargets = [] @@ -86,13 +91,44 @@ pipeline { triggers { pollSCM('* * * * *') } + parameters { + choice name: 'RUN_TYPE', + choices: ['normal', 'setup' ], + description: run_type_description + } options { disableConcurrentBuilds() timestamps () buildDiscarder(logRotator(numToKeepStr: '100')) } stages { + + stage('Setup') { + when { + anyOf { + triggeredBy 'JobDslCause'; + environment name: 'RUN_TYPE', value: 'setup' + } + } + steps { + script { + String note = 'Project configuration parsed.' + echo note + currentBuild.description = note + currentBuild.result = 'NOT_BUILT' + } + } + } + stage('Checkout') { + when { + not { + anyOf { + triggeredBy 'JobDslCause'; + environment name: 'RUN_TYPE', value: 'setup' + } + } + } steps { script { utils = load "utils.groovy" } dir(WORKDIR) { @@ -110,6 +146,14 @@ pipeline { } stage('Evaluate') { + when { + not { + anyOf { + triggeredBy 'JobDslCause'; + environment name: 'RUN_TYPE', value: 'setup' + } + } + } steps { dir(WORKDIR) { script { @@ -121,6 +165,14 @@ pipeline { } stage('Build targets') { + when { + not { + anyOf { + triggeredBy 'JobDslCause'; + environment name: 'RUN_TYPE', value: 'setup' + } + } + } steps { script { parallel target_jobs