我正在使用jenkins-job-builder创建我的管道项目。但是当我尝试重用或传播时,变量值有问题。
这是我的项目配置:
- project:
name: myproject
git_url: git@gitlabserver.cu:demos-products/myproject.git
jobs:
- '{name}-nfr-smoke-tests':
pipeline-next: '{name}-nfr-smoke-tests'
这是我的工作模板:
- job-template:
name: "{name}-nfr-smoke-tests"
node: 'slave1'
scm:
- git:
skip-tag: false
url: 'git@gitlabserver.cu:test-products/{name}-nfr-tests.git'
branches:
- master
wipe-workspace: true
builders:
- shell: |
bundle install
bundle exec cucumber features/smoke.feature
publishers:
- trigger:
project: "{pipeline-next}"
threshold: SUCCESS
好的,现在当我在 jenkins 中运行此配置并检查作业的构造时,它说:
No such project ‘{name}-nfr-smoke-tests’. Did you mean ‘myproject-nfr-smoke-tests’?
为什么行:pipeline-next: '{name}-nfr-smoke-tests'
不传播变量名称的值而只是将其用作文字字符串?我错过了一些东西。