在多分支管道中授予复制artIfact权限

在多分支管道中授予复制artIfact权限

本文介绍了在多分支管道中授予复制artIfact权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:

通过Jenkinsfile配置的Jenkins多分支管道作业.成功签出并构建后,将对工件进行存档,并触发下游作业以部署生成的工件.

A Jenkins multi-branch pipeline job configured through Jenkinsfile. After successful checkout and build, the artifact is archived and a downstream job is triggered to deploy the generated artifact.

要使第二项作业能够通过[$class: 'CopyArtifact'...步骤复制艺术品,它需要复制权限.

For the second job to be able to copy the artefact through the [$class: 'CopyArtifact'... step, it needs copy permissions.

问题是,如何通过上游作业的Jenkinsfile授予这些权限?

So the question is, how do I grant those permissions through the Jenkinsfile of the upstream job?

推荐答案

对于脚本化管道语法,此方法有效:

For Scripted Pipeline Syntax, this works:

  properties([[$class: 'CopyArtifactPermissionProperty', projectNames: 'Other Project Name'], [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false], pipelineTriggers([])])

这篇关于在多分支管道中授予复制artIfact权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 22:26