使用此工作,使用 FTP 或透過 FTPS 安全地將檔案上傳至遠端電腦。
此版本的工作已被取代;使用 FtpUpload@2。
使用此工作,使用 FTP 或透過 FTPS 安全地將檔案上傳至遠端電腦。
語法
# FTP upload v1
# Upload files using FTP.
- task: FtpUpload@1
inputs:
credentialsOption: 'serviceEndpoint' # 'serviceEndpoint' | 'inputs'. Alias: credsType. Required. Authentication Method. Default: serviceEndpoint.
serverEndpoint: # string. Required when credsType = serviceEndpoint. FTP Service Connection.
#serverUrl: # string. Required when credsType = inputs. Server URL.
#username: # string. Required when credsType = inputs. Username.
#password: # string. Required when credsType = inputs. Password.
rootDirectory: # string. Alias: rootFolder. Required. Root folder.
filePatterns: '**' # string. Required. File patterns. Default: **.
remoteDirectory: '/upload/$(Build.BuildId)/' # string. Alias: remotePath. Required. Remote directory. Default: /upload/$(Build.BuildId)/.
# Advanced
#clean: false # boolean. Delete remote directory. Default: false.
#cleanContents: false # boolean. Optional. Use when clean = false. Clear remote directory contents. Default: false.
#overwrite: true # boolean. Overwrite. Default: true.
#preservePaths: false # boolean. Preserve file paths. Default: false.
#trustSSL: false # boolean. Trust server certificate. Default: false.
輸入
credentialsOption
-
驗證方法
輸入別名: credsType。
string。 必須的。 允許的值:serviceEndpoint(FTP 服務連線)、inputs(輸入認證)。 預設值:serviceEndpoint。
指定驗證方法。 使用 FTP 服務連線或輸入連線認證。
serverEndpoint
-
FTP 服務連線
string。
credsType = serviceEndpoint時為必要項。
指定 FTP 伺服器的服務連線。 若要建立一個,請按兩下 [管理] 連結並建立新的一般服務連線,然後輸入伺服器URL的FTP伺服器URL,例如 ftp://server.example.com和所需的認證。
如果目標伺服器支援 FTPS,無論指定的通訊協定(ftp:// 或 ftps://),都會建立安全連線。 若要只允許安全的連線,請使用 ftps:// 通訊協定,例如 ftps://server.example.com。 如果指定 ftps://,不支援 FTPS 的伺服器連線將會失敗。
serverUrl
-
伺服器 URL
string。
credsType = inputs時為必要項。
指定 FTP 伺服器的 URL。
username
-
用戶名稱
string。
credsType = inputs時為必要項。
指定 FTP 連線的用戶名稱。
password
-
密碼
string。
credsType = inputs時為必要項。
指定 FTP 連線的密碼。
remoteDirectory
-
遠端目錄
輸入別名: remotePath。
string。 必須的。 預設值:/upload/$(Build.BuildId)/。
指定工作上傳檔案之遠端 FTP 伺服器上的目錄。
clean
-
刪除遠端目錄
boolean。 預設值:false。
先刪除遠端目錄,包括其內容,再上傳。
cleanContents
-
清除遠端目錄內容
boolean。 選擇性。
clean = false時使用 。 預設值:false。
遞歸刪除遠端目錄中的所有內容,再上傳。 將不會刪除現有的目錄。 為了提升效能,請改用 clean。
overwrite
-
覆寫
boolean。 預設值:true。
覆寫遠端目錄中的現有檔案。
preservePaths
-
保留檔案路徑
boolean。 預設值:false。
如果選取,則會在上傳檔案的遠端目錄下重新建立相對本機目錄結構。 否則,檔案會直接上傳至遠端目錄,而不會建立其他子目錄。
例如,假設您的源資料夾是 /home/user/source/,其中包含檔案 foo/bar/foobar.txt,而您的遠端目錄為:/uploads/。 勾選取此布林值,檔案會上傳至 /uploads/foo/bar/foobar.txt。 如果未選取此布林值,檔案會上傳至 /uploads/foobar.txt。
trustSSL
-
信任伺服器證書
boolean。 預設值:false。
使用 ftps://信任 FTP 伺服器的 SSL 憑證,即使它是自我簽署或無法由證書頒發機構單位 (CA) 驗證也一樣。
工作控制選項
除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性。
輸出變數
沒有。
備註
使用此工作,使用 FTP 或透過 FTPS 安全地將檔案上傳至遠端電腦。
備註
有較新版本的工作可在 FtpUpload@2取得。
我可以在哪裡深入瞭解檔案比對模式?
需求
| 要求 | 說明 |
|---|---|
| 管線類型 | YAML、傳統組建、傳統版本 |
| 執行於 | Agent、DeploymentGroup |
| 需求 | 沒有 |
| 功能 | 此工作不符合作業中後續工作的任何需求。 |
| 命令限制 | 此工作會使用下列 命令限制執行: 受限制 |
| Settable 變數 | 此工作有權 設定下列變數:已停用設定變數 |
| 代理程式版本 | 2.182.1 或更新 |
| 工作類別 | 效用 |