简体   繁体   中英

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/

  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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