Continuous integration Gitlab CI/CD执行特定阶段而不是所有阶段
我的Continuous integration Gitlab CI/CD执行特定阶段而不是所有阶段,continuous-integration,gitlab,gitlab-ci,gitlab-ci-runner,Continuous Integration,Gitlab,Gitlab Ci,Gitlab Ci Runner,我的gitlab ci.yml文件中有几个阶段 例如: stages: - one - two - three if [ <condition 1> ]; then run all stages; if [ <condition 2> ]; then run stage "one"; if [ <condition 3> ]; then run stages "two" and "three"; fi 是否有可能运行指定的阶段?
gitlab ci.yml
文件中有几个阶段
例如:
stages:
- one
- two
- three
if [ <condition 1> ]; then
run all stages;
if [ <condition 2> ]; then
run stage "one";
if [ <condition 3> ]; then
run stages "two" and "three";
fi
是否有可能运行指定的阶段?在Makefile中,它被称为“目标”。我希望在不同的情况下执行不同的阶段。例如:
stages:
- one
- two
- three
if [ <condition 1> ]; then
run all stages;
if [ <condition 2> ]; then
run stage "one";
if [ <condition 3> ]; then
run stages "two" and "three";
fi
if[];然后
运行所有阶段;
如果[];然后
运行第一阶段;
如果[];然后
运行“二”和“三”阶段;
fi
您可以使用规则在作业级别执行此操作
此外,一个作业只能包含一个作业。因此,在.gitlab ci.yml
中创建3个作业,每个阶段一个,并配置如下规则(查看文档了解更多示例),例如: