这是子管道的内容,从 jinja 模板生成并在上一个作业中存储为工件。
触发此子管道时,它表示此子管道没有阶段或没有作业。
Test_Container_10.10.102.240:
stage: TEST
image: docker
services:
- docker:dind
extends: .job_AWX_TEMPLATE_TEST_APT
variables:
dest_ip: 10.10.102.240
srv_type: svc_all_apt
artifacts:
paths:
- './apt*'
rules:
- if: $srv_type == 'svc_all_apt'
when: on_success
在变量部分,srv_type 值是由 jinja 模板中的 python 代码提供的。
当我禁用规则部分时,该管道可以工作。 即使我使用规则运行与父管道相同的代码,它也能工作。
Why rule section is not working in the child pipeline
srv_type variable value comes from python code, in the previous job.
Do I need to pass this value from the parent pipeline in this job.
如果:$srv_type == 'svc_all_apt'
您需要对值使用双引号,而不是单引号。
rules:
- if: $srv_type == "svc_all_apt"