如何使Jenkins构建在以后触发另一个构建? [英] How to make a Jenkins build trigger another build at a later time?

查看:963
本文介绍了如何使Jenkins构建在以后触发另一个构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Jenkins中创建两个版本-我们将它们称为设置"和测试".安装程序构建应从Git和SVN中提取开发代码,并在从站上进行必要的设置(编译等)以设置我们的应用程序.它应该仅在有SCM更改时运行.测试版本应从Git中提取自动回归测试代码,在从服务器上进行必要的设置以准备好测试,并在每晚对开发代码进行SCM更改的午夜运行测试.如果开发人员代码没有SCM更改,我不希望运行测试"作业.

I'm trying to create two builds in Jenkins - let's call them Setup and Testing. The Setup build should pull dev code from Git and SVN and do the necessary setup on the slave (compile, etc.) to set up our application. It should run only when there are SCM changes. The Testing build should pull automated regression test code from Git, do the necessary setup on the slave to get the tests ready, and run the tests at midnight every night there are SCM changes to the dev code. I do not want the Testing job to run if there are no SCM changes to the dev code.

这是我的问题.我知道如何使安装程序生成仅在有SCM更改时才运行.我知道如何使测试版本按计划运行.我似乎无法弄清楚的是如何使安装程序构建触发测试构建,但直到午夜才运行测试构建.我只能在安装程序完成后立即运行它,这不是我想要的(我们确实有运行实时CI接受测试的方式,但我们的回归套件的用途略有不同).

Here's my problem. I know how to make the Setup build only run when there are SCM changes. I know how to make the Testing build run on a schedule. What I can't seem to figure out is how to make the Setup build trigger the Testing build, but not run the Testing build until midnight. I can only make it run right away when Setup finishes, which isn't what I want (we do have real-time CI acceptance tests that run like this, but our regression suite serves a slightly different purpose).

我想寻找的是一种传递标志的方式,例如SCM_CHANGES=TRUE,并且仅在计划的时间if (SCM_CHANGES)运行测试.不过,我可能忽略了执行此操作的另一种方法-我愿意提出建议.

What I think I'm looking for is a way to pass a flag, like SCM_CHANGES=TRUE, and only run Testing at its scheduled time if (SCM_CHANGES). I may be overlooking a different way of doing this, though - I'm open to suggestions.

推荐答案

类似于 BuildResultTrigger插件可能会解决您的问题-有了它,您可以设置测试"作业来监视设置"作业的结果,并安排每天晚上午夜的时间表.

Sounds like the BuildResultTrigger Plugin might solve your problem - with it, you could set up the Testing job to monitor the result of the Setup job, with a schedule for midnight, every night.

在午夜时分,它将检查是否有版本的安装程序(并且结果符合条件),如果是,则触发新的测试运行.

At midnight it will check if there was a new build of Setup (and the result matches a criteria), and if yes, trigger a new Testing run.

这篇关于如何使Jenkins构建在以后触发另一个构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆