简体   繁体   English

如何在詹金斯奴隶中运行后构建任务?

[英]how to run post build task in jenkins slave?

我有一个要求,我需要在jenkins从属计算机上运行postbuild任务。我无法使用属性“ 限制可以在哪里运行该项目 ”,因为无需在从属系统中运行整个项目。

Two possibilites: 两个可能性:

  1. Use jenkins pipeline 使用詹金斯管道

    node("master") { stage("do main build thing") { // do something } } node("slave") { stage("do postbuild") { // do post build task } }
    More information about the jenkins pipeline https://jenkins.io/doc/book/pipeline/jenkinsfile/ 有关jenkins管道的更多信息https://jenkins.io/doc/book/pipeline/jenkinsfile/

  2. Use a second job 再做一份工作
    You can configure a job which only executes the post build task and restrict it to the slave with "Restrict where this project can be run". 您可以通过“限制在何处可以运行该项目”来配置仅执行后构建任务并将其限制为从属的作业。 On the main job you add a post build action: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin 在主要工作上,您添加一个后构建操作: https : //wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM