当构建来自要素分支时,我们需要运行阶段,我们在feat / 123 feat / abc ...下创建要素分支,因此当构建来自于feat / *等任何要素分支时,都需要执行阶段。
尝试设置以下条件,但没有成功。
jobs:
- job: DockerBuildtask
condition: and(succeeded(), or(eq(variables['build.sourceBranch'], 'refs/heads/develop'), eq(variables['build.sourceBranch'], 'refs/heads/release'), eq(variables['build.sourceBranch'], 'refs/heads/feat.*'), eq(variables['build.sourceBranch'], 'refs/heads/bugfix.*')))
jobs:
- job: DockerBuildtask
condition: and(succeeded(), or(eq(variables['build.sourceBranch'], 'refs/heads/develop'), eq(variables['build.sourceBranch'], 'refs/heads/release'), eq(variables['build.sourceBranch'], 'refs/heads/feat/*.'), eq(variables['build.sourceBranch'], 'refs/heads/bugfix/*.')))
jobs:
- job: DockerBuildtask
condition: and(succeeded(), or(eq(variables['build.sourceBranch'], 'refs/heads/develop'), eq(variables['build.sourceBranch'], 'refs/heads/release'), eq(variables['build.sourceBranch'], 'refs/heads/feat*.'), eq(variables['build.sourceBranch'], 'refs/heads/bugfix*.')))
但无法成功..我在这里错过了什么吗?
你有eq(variables['build.sourceBranch'], 'refs/heads/feat.')
,在你的情况下应该是contains(variables['build.sourceBranch'], 'refs/heads/feat')
。我假设您已正确设置CI触发器。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句