gitlab-ci:当众多其他工作之一或完成时,如何经营工作
我需要设置一个在完成其他几个作业之一之后开始运行的作业,这些作业都处于同一阶段。
I ve tried to use the keyword "needs" , but i didn't recognize how to tell it to consider the case of "if only one among all job is done"
What i'm looking for , is some way to get it :
if : JOB_A is done OR JOB_BA is done
then : Run JOB_C
JOB_A
stage: mystage
...
JOB_B
stage: mystage
...
JOB_C:
stage: mystage
variables:
PLAYBOOK_NAME: myplaybook.yml
INVENTORY_NAME: myInventory.yml
needs: [JOB_A or JOB_B] # THIS is a wrong way to set it i think
when: manual
Suggestions ??
I need to set a job that starts running after one of several other jobs are done , that are all in the same stage.
I ve tried to use the keyword "needs" , but i didn't recognize how to tell it to consider the case of "if only one among all job is done"
What i'm looking for , is some way to get it :
if : JOB_A is done OR JOB_BA is done
then : Run JOB_C
JOB_A
stage: mystage
...
JOB_B
stage: mystage
...
JOB_C:
stage: mystage
variables:
PLAYBOOK_NAME: myplaybook.yml
INVENTORY_NAME: myInventory.yml
needs: [JOB_A or JOB_B] # THIS is a wrong way to set it i think
when: manual
Suggestions ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您描述的用例中,需要手动运行所需的作业,因此只有在运行它们时才添加到管道中,因此您应该能够将需求与可选集合为true的需求,如在这里需要以这种方式需要所有作业。
我不得不说,在手动工作之后,我对自动化工作的需求并不相信。在我看来,通过使用环境变量,可以将几项手动作业重构,但我们没有足够的信息来帮助您进行此设计。
In the use case you describe, the needed jobs are manually run and so are only added to the pipeline when you run them, so you should be able to use needs with optional set to true as described in the doc here needing all the jobs this way could fit your use case.
I have to say I'm not convinced by the need of automating jobs after with manual jobs. It seems to me the several manual jobs could be refactored in one with the use of environment variables, but we don't have enough info to help you on this design.