DownloadSecureFile@1 - 下載安全檔案 v1 工作

使用此工作將安全檔案下載至代理程式電腦。

使用此工作將安全檔案下載到代理程式電腦上的暫存位置。

使用此工作將安全檔案下載至組建或發行代理程式上的暫存位置。

Syntax

# Download secure file v1
# Download a secure file to the agent machine.
- task: DownloadSecureFile@1
  inputs:
    secureFile: # string. Required. Secure File. 
    #retryCount: '8' # string. Retry Count. Default: 8.
    #socketTimeout: # string. Socket Timeout.
# Download secure file v1
# Download a secure file to the agent machine.
- task: DownloadSecureFile@1
  inputs:
    secureFile: # string. Required. Secure File. 
    #retryCount: '5' # string. Retry Count. Default: 5.
# Download secure file v1
# Download a secure file to a temporary location on the agent machine.
- task: DownloadSecureFile@1
  inputs:
    secureFile: # string. Required. Secure File.
# Download Secure File v1
# Download a secure file to a temporary location on the build or release agent.
- task: DownloadSecureFile@1
  inputs:
    secureFile: # string. Required. Secure File.

輸入

secureFile - 安全檔案
string. 必要。

指定下載至代理程式電腦之安全檔案的名稱或唯一識別碼 (GUID) 。 管線作業完成時,會刪除檔案。


retryCount - 重試計數
string. 預設值:8

選擇性。 指定下載失敗時重試下載安全檔案的次數。


retryCount - 重試計數
string. 預設值:5

選擇性。 指定下載失敗時重試下載安全檔案的次數。


socketTimeout - 通訊端逾時
string.

選擇性。 在 Microsoft 中下載安全檔案要求時,此輸入會指定通訊端的逾時。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性

輸出變數

此工作會定義下列 輸出變數,您可以在下游步驟、作業和階段中取用這些變數。

secureFilePath
指定已下載的安全檔案位置。

備註

在管線中使用這項工作,將 安全檔案 下載到代理程式電腦。 使用 secureFile 輸入) 指定檔案名 (時,請使用您在上傳檔案時所指定的名稱,而不是實際的檔案名。

下載之後,請使用 name 傳統編輯器中工作 (或「參考名稱」上設定的值,) 參考代理程式電腦上安全檔案的路徑。 例如,如果工作指定名稱 mySecureFile ,則可以在管線中將其路徑參考為 $(mySecureFile.secureFilePath) 。 或者,下載的安全檔案可以在 所提供的 $(Agent.TempDirectory) 目錄中找到。 請參閱 下方的完整範例。

當管線作業完成時,不論其成功、失敗或取消,安全檔案會從其下載位置刪除。

不需要搭配 安裝 Apple 憑證安裝 Apple 布建設定檔 工作使用此工作,因為它們會在管線作業結尾自動下載、安裝及刪除 (,) 安全檔案。

此工作目前僅支援每個實例一個檔案工作。

範例

此範例會下載安全的憑證檔案,並將其安裝至 Linux 上受信任的憑證授權單位單位 (CA) 目錄:

- task: DownloadSecureFile@1
  name: caCertificate
  displayName: 'Download CA certificate'
  inputs:
    secureFile: 'myCACertificate.pem'

- script: |
    echo Installing $(caCertificate.secureFilePath) to the trusted CA directory...
    sudo chown root:root $(caCertificate.secureFilePath)
    sudo chmod a+r $(caCertificate.secureFilePath)
    sudo ln -s $(caCertificate.secureFilePath) /etc/ssl/certs/ 

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
執行于 Agent、DeploymentGroup
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 此工作會使用下列 命令限制來執行:受限制
Settable 變數 此工作具有 設定下列變數的許可權:secureFilePath
代理程式版本 2.182.1 或更新版本
工作類別 公用程式
需求 描述
管線類型 YAML、傳統組建、傳統版本
執行于 Agent、DeploymentGroup
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 2.116.0 或更新版本
工作類別 公用程式