jenkins插件之Publish Over SSH

 

說明

這個插件能夠經過ssh鏈接其餘服務器。git

 

公共配置

Passphrase:密碼服務器

Path to key:key文件(私鑰)的路徑app

Key:將私鑰複製到這個框中ssh

Disable exec:禁止運行命令ide

 

p_w_picpath

 

 

私有配置

SSH Server Name:服務器名稱。測試

Hostname:須要鏈接ssh的主機名或ip地址ui

Username:用戶名spa

Remote Directory:遠程目錄.net

Use password authentication, or use a different key:能夠替換公共配置插件

私有配置的高級:

Port:端口

Timeout (ms):超時時間(毫秒)默認便可

Disable exec:禁止運行命令

Test Configuration:測試鏈接

p_w_picpath

 

項目配置

在項目配置中,能夠從下面三個地方找到此插件的配置。

 

構建環境: Send files or execute commands over SSH before the build starts 和Send files or execute commands over SSH after the build runs

 

clip_p_w_picpath006

 

 

構建步驟:Send files or execute commands over SSH

 

clip_p_w_picpath007

 

 

構建後操做:Send build artifacts over SSH

 

clip_p_w_picpath008

 

 

p_w_picpath

 

SSH  Server Name:選個一個你在系統設置裏配置的配置的名字

Transfer Set Source files:須要上傳的文件(注意:相對於工做區的路徑。看後面的配置能夠填寫多個,默認用,分隔)

Remove prefix:移除目錄(只能指定Transfer Set Source files中的目錄)

Remote directory:遠程目錄(根據你的需求填寫吧,由於我這兒是測試,因此偷懶沒有填寫。默認會繼承系統配置)

高級:

Exclude files:排除的文件(在你傳輸目錄的時候頗有用,使用通配符,例如:**/*.log,**/*.tmp,.Git/)

Pattern separator:分隔符(配置Transfer Set Source files的分隔符。若是你這兒更改了,上面的內容也須要更改)

No default excludes:禁止默認的排除規則

Make empty dirs:此選項會更改插件的默認行爲。默認行爲是匹配該文件是否存在,若是存在則建立目錄存放。選中此選項會直接建立一個目錄存放文件,即便是空目錄。

Flatten files:只上傳文件,不建立目錄(除了遠程目錄)

Remote directory is a date format:遠程目錄創建帶日期的文件夾(須要在Remote directory中配置日期格式),具體格式參考下表:

Remote directory

Directories created

'qa-approved/'yyyyMMddHHmmss

qa-approved/20101107154555

'builds/'yyyy/MM/dd/'build-${BUILD_NUMBER}'

builds/2010/11/07/build-456 (if the build was number 456)

yyyy_MM/'build'-EEE-d-HHmmss

2010_11/build-Sun-7-154555

yyyy-MM-dd_HH-mm-ss

2010-11-07_15-45-55

相關文章
相關標籤/搜索