本文介绍了建筑/等待父作业最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有Maven项目与结构混帐

We have maven projects on git with structure of

--
  pro-A
  --
    pro-B
    --
      pro-C
      pro-D
      --
        pro-E

这些都是项目与混帐自己的回购和自己积聚在管道与詹金斯阶段如下:

These are all project with their own repo in git and their own build-pipeline in jenkins with stages as follows

build  -- deploy to TEST -- run tests -- (manual tigger) deploy to QA

每次构建被部署詹金斯集结号追加到它和合并,从主标签释放分支新的版本号到Maven回购:如1.0.9-649

every build gets deployed to maven repo with jenkins build number appended to it and merge to release branch from master and tag with the new version number: e.g. 1.0.9-649

所以,亲-A是所有项目的父,亲-B仅取决于亲-A,亲-C和亲-D是在相同的水平,他们不依赖于对方,但对亲依赖B,PRO-E对所有其他的依赖亲-A,B,C,D

So, pro-A is parent of all projects, pro-B only depends on pro-A, pro-C and pro-D are at the same level they don't depend on each other but have dependency on pro-B, pro-E have dependency on all others pro-A,B,C,D

当一个变化是推动gitlab触发为各自的项目构建。现在的问题是,当,说A和D的变化和Ds的构建之前,有一个很好的机会,因为它依赖于一个较新的code构建失败被触发。

When a change is pushed gitlab triggers a build for the respective project. Now the problem is that when, say A and D changes and Ds build is triggered before a there is a good chance that the build fails as it depends on the newer code of A.

我的问题是,是否有可能暂停Ds的建设,直到完成建设?

My question is, is it possible to pause the Ds build until A finishes building?

我在D中试的pre-一步思考的东西要看看最新提交具有比发布分支稍后时间戳然后触发父身材,但不知道怎么样?

I was thinking something like in pre-step of D try to see if latest commit has a later timestamp than the release branch then trigger a build on parent, but don't know how?

推荐答案

有一种方法可以暂停D的生成,直到完成。您必须安装:参数化触发插件。一旦安装,进入D的配置。在构建,添加构建步骤,选择触发器/呼叫建立在其他项目

There is a way to pause D's build until A finishes. You will have to install: "Parametrized Trigger Plugin". Once installed, go to D's configuration. Under Build, Add build step, select "Trigger/Call builds on other projects".

之后,认沽A项目建设,然后检查阻止,直到触发项目完成他们建立。保存配置。

After that put "A" in "Projects to build" and then check "Block until the triggered projects finish their builds". Save the configuration.

这应该满足你的要求。

This should fulfill your requirement.

这篇关于建筑/等待父作业最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 14:34