簡體   English   中英

Jenkins只構建了一個被推送的分支

[英]Jenkins build only one branch that has been pushed

我想配置Jenkins只構建一個分支已被推送到github。 我嘗試在Branch Specifier留空

但在我提交/推動后,所有分支都將建成。 我只需要一個剛剛提交/推送的分支。 我怎樣才能做到這一點? 謝謝。

您是否考慮過外部掛鈎觸發的管道 如果github支持掛鈎(我不知道)你可以在post-receive hook中執行類似下面的操作。 只有在代碼被推送到開發分支時,這才會運行作業。

while read oldrev newrev ref
do
    if [[ $ref =~ .*/development$ ]];
    then
            curl -s http://jenkins:8080/job/stage/build
            echo Jenkins pipeline triggered by calling the webservice
    fi
done

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM