执行单个Gitlab CI管道的多个跑步者
我有一个gitlab CI配置为在部署每个服务器之前仅在3个不同的服务器上构建和部署代码,并仅在部署每个服务器之前进行较小的更改。在部署之前,我根据服务器部署了一些文件,并将其推到CI管道的同一仓库中。 为此,我想使用3个不同的跑步者来运行以构建和部署代码到每个服务器,但找不到该方法。 我可以在多个跑步者上并行运行(使用并行矩阵)在管道中运行的每个作业,但是作业运行的顺序(即首先在所有跑步者上执行1个作业),在部署作业之前,更改将不会持续。
有什么方法可以触发多个跑步者执行同一作业?还是他们的解决方法。
I have a gitlab CI configured to build and deploy code to 3 different servers with just minor changes before deploying each. Before deploying, I edit some files based on the server they are being deployed and push to the same repo from the CI pipeline.
For this purpose, I want to use 3 different runners to run in order to build and deploy the code to each server but couldn't find how to do it.
I can make each job in pipeline to run in parallel (using parallel matrix) on multiple runners, but the order in which the jobs run (i.e. execute 1 job first on all runners), the changes will not persist till the deploy job.
Is there a way I can trigger multiple runners to execute same job? or is their a workaround.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
定义唯一 tags 对于您的每个跑步者代码>,
deploy-rhel8
,deploy-solaris
)。创建一个“ nofollow noreferrer”>模板作业和三个工作(每个目标系统)(一个目标系统)扩展模板作业。然后定义所需的标签对于这三个工作中的每一个。
享受成功,每个作业都在自己的特定跑步者上运行,部署正确的软件版本。
Define unique tags for each of your runners (ex.
deploy-win11
,deploy-rhel8
,deploy-solaris
).Create a template job and three jobs (each for one target system) that extends the template job. Then define required tags for each of these three jobs.
Enjoy success, where each job runs on its own specific runner, deploying the correct version of your software.
我不确定我完全理解这个问题,但是我认为您缺少
阶段
。您可以在
.gitlab-ci.yml
中定义这样的阶段(您可以根据需要命名):
这样,管道将等到所有
构建
作业完成后将其运行test
作业。现在,您必须指定工作应执行的阶段:
I'm not sure I completely understand the question, but I think you're missing
stages
.You can define your stages like this in your
.gitlab-ci.yml
(you can name them however you want):
This way, the pipeline will wait until all
build
jobs finish before it will run thetest
jobs.Now, you have to specify in which stage a job should execute: