Publish over FTP發佈報錯

簡介

Publish over FTP是Jenkins中用於FTP傳輸文件的插件。

報錯:Could not create or change to directory

在這裏插入圖片描述
這個是因爲不支持中文目錄。
雖然Jenkins說明中推薦中文配置爲GB2312,但其實我們一般通用的作法是設置爲UTF-8,兼容各類操作系統和構建環境。

處理

在這裏插入圖片描述

【系統管理】->【系統設置】->【Publish over FTP】->高級:【Control encoding】->輸入【UTF-8】或者【GB2312】

報錯:Could not write file

在這裏插入圖片描述
不支持FTP被動模式(PASV)
一種是在FTP服務端開啓PASV被動模式(一般默認兩種模式都開啓了,但不排除沒有開啓的情況,就導致這個問題)

另一種方式就是改變Jenkins的連接模式,通過官網也能找到這一段話:

Use active data mode
By default passive mode will be used to connect to the FTP Server.
In passive mode the client initiates all connections which will allow the client to send files through a firewall that has been configured to refuse all inbound connections (and does not create dynamic rules).
If you want to dissable passive mode, and have the client use PORT commands for the server to connect to the client to retieve the files, then you can check this box.

解決

在這裏插入圖片描述

【系統管理】->【系統設置】->【Publish over FTP】->高級:勾選【Use active data mode】

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章