diff --git a/vars/piperPipelineStageInit.groovy b/vars/piperPipelineStageInit.groovy index fbc83f4a7..bd8cafd6b 100644 --- a/vars/piperPipelineStageInit.groovy +++ b/vars/piperPipelineStageInit.groovy @@ -43,7 +43,12 @@ import static com.sap.piper.Prerequisites.checkScript */ 'projectName', /** - * Defines the library resource containing stage/step initialization settings. Those define conditions when certain steps/stages will be activated. **Caution: changing the default will break the standard behavior of the pipeline - thus only relevant when including `Init` stage into custom pipelines!** + * Specify to execute artifact versioning in a kubernetes pod. + * @possibleValues `true`, `false` + */ + 'runArtifactVersioningOnPod', + /** + * Defines the library resource containing stage/step initialization settings. Those define conditions when certain steps/stages will be activated. **Caution: changing the default will break the standard behavior of the pipeline - thus only relevant when including `Init` stage into custom pipelines!** */ 'stageConfigResource', /** @@ -201,7 +206,7 @@ void call(Map parameters = [:]) { if (config.inferBuildTool) { prepareVersionParams.buildTool = buildTool } - if (env.ON_K8S) { + if (env.ON_K8S && !config.runArtifactVersioningOnPod) { // We force dockerImage: "" for the K8S case to avoid the execution of artifactPrepareVersion in a K8S Pod. // Since artifactPrepareVersion may need the ".git" folder in order to push a tag, it would need to be part of the stashing. // There are however problems with tar-ing this folder, which results in a failure to copy the stash back -- without a failure of the pipeline.