使用Jenkins在多个环境中顺序运行作业任务 [英] Running sequentially job tasks on several environments using Jenkins

查看:255
本文介绍了使用Jenkins在多个环境中顺序运行作业任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是詹金斯的新手.我正在尝试在一项工作中实现特定场景,以使用Jenkins构建移动应用程序.

I'm new to Jenkins. I'm trying to implement a specific scenario in a single job to build mobile applications using Jenkins.

在一个作业中,我想依次启动几个任务: 任务1(Windows)--->任务2(Windows)--->任务3(Windows)--->任务4(Mac OSX)

In a single job I want to launch several tasks sequentially: Task 1 (Windows) ---> Task 2 (Windows) ---> Task 3 (Windows) ---> Task 4 (Mac OSX)

每项工作都将致力于一个项目.从一个任务到另一个任务的结果传递可以通过工作空间来实现,但是看来任务任务必须全部在同一环境中运行.是否有任何插件可以让我在特定的从属服务器上运行某些任务?

Each job will be dedicated to a single project. Passing results from a task to another can be realised through the workspace, but it seems that job tasks must all run on the same environment. Is there any plugin that will let me run some tasks of the job in a particular slave ?

预先感谢

推荐答案

您可以在从属作业上使用远程触发版本. 然后,可以从主作业中使用curl执行从属构建.像这样:

You could use trigger builds remotely on your slave jobs. Then from the master job you can execute slave builds using curl. Like this:

$(curl --user "username:password" "http://jenkins.yourdomain.org/job/JOB-name/buildWithParameters?SOMEPARAMETER=$SOMEPARAMETER&token=TheSecretToken")

TheSecretToken 是您在从属插件上指定的令牌密码. username:password是您的詹金斯上的有效用户.请勿在此处使用您自己的帐户,而应使用仅具有启动特定作业权限的构建触发"帐户.

TheSecretToken is the token password you specified on your slave plugins. And username:password is a valid user on your jenkins. Don't use your own account here but rather a 'build trigger' account that only has permissions to start specific jobs.

这篇关于使用Jenkins在多个环境中顺序运行作业任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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