jenkins使用Publish Over SSH中遇到的問題


在jenkins中想使用publish over ssh來在構建后發送XML或PNG文件至服務器,以便做其它的操作,安裝完publish over ssh后,填加構建,發現在構建失敗時,不傳送文件,老提示:

SSH: Current build result is [FAILURE], not going to run.



一直不知道原因,按照stackoverflow也無法解決.https://stackoverflow.com/questions/31386012/jenkins-publish-over-ssh-after-failed-build

沒辦法,只有查看官網看看有沒有線索

官網網站:https://wiki.jenkins.io/display/JENKINS/Publish+Over+SSH+Plugin

 

有這樣一段說明:

 
         

Build wrappers

 
         

There will be two new options in the Build Environment section of the job configuration

 
         
    1. Send files or execute commands over SSH before the build starts
      This allows SSH to be used before a build begins, but after the workspace has been configured and source checked out
      Most useful for maven project types
    2. Send files or execute commands over SSH after the build runs
      As long as the build was attempted, this will run after the build finishes, and will run whether the build is successful or not
      This allows cleanup or shutdown of services started before or during the build
      Use the publisher (Send build artifacts over SSH in Post-build Actions) to publish build artifacts from succesful builds
 

原來問題在這里,什么意思呢?翻譯一下吧

在構建環境選項中,也可以使用public by ssh,這里使用是無論構建成功與否都會執行public by ssh;然后如果使用publisher,在構建后操作就只能在構建成功時才會執行ssh

來圖說明下吧

下圖選擇后,無論構建成功與否都會進行SSH發文件

 

如果在選擇增加構建后操作步驟,就只能構建成功后才會SSH

 

看來多看官網才是正解


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM