共用方式為


InstallAppleCertificate@2 - 安裝 Apple 憑證 v2 工作

使用此工作來安裝在 macOS 代理程式上建置所需的 Apple 憑證。 您可以使用這項工作來安裝儲存為伺服器上 安全檔案 的 Apple 憑證。

語法

# Install Apple certificate v2
# Install an Apple certificate required to build on a macOS agent machine.
- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: # string. Required. Certificate (P12). 
    #certPwd: # string. Certificate (P12) password. 
  # Advanced
    keychain: 'temp' # 'default' | 'temp' | 'custom'. Required. Keychain. Default: temp.
    #keychainPassword: # string. Required when keychain = custom || keychain = default. Keychain password. 
    #customKeychainPath: # string. Required when keychain = custom. Custom keychain path. 
    #deleteCert: # boolean. Optional. Use when keychain = custom || keychain = default. Delete certificate from keychain. 
    #deleteCustomKeychain: # boolean. Optional. Use when keychain = custom. Delete custom keychain. 
    #signingIdentity: # string. Certificate signing identity. 
    #setUpPartitionIdACLForPrivateKey: # boolean. Set up partition_id ACL for the imported private key. 
    #opensslPkcsArgs: # string. OpenSSL arguments for PKCS12.
# Install Apple certificate v2
# Install an Apple certificate required to build on a macOS agent machine.
- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: # string. Required. Certificate (P12). 
    #certPwd: # string. Certificate (P12) password. 
  # Advanced
    keychain: 'temp' # 'default' | 'temp' | 'custom'. Required. Keychain. Default: temp.
    #keychainPassword: # string. Required when keychain = custom || keychain = default. Keychain password. 
    #customKeychainPath: # string. Required when keychain = custom. Custom keychain path. 
    #deleteCert: # boolean. Optional. Use when keychain = custom || keychain = default. Delete certificate from keychain. 
    #deleteCustomKeychain: # boolean. Optional. Use when keychain = custom. Delete custom keychain. 
    #signingIdentity: # string. Certificate signing identity. 
    #setUpPartitionIdACLForPrivateKey: # boolean. Set up partition_id ACL for the imported private key.
# Install Apple certificate v2
# Install an Apple certificate required to build on a macOS agent machine.
- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: # string. Required. Certificate (P12). 
    #certPwd: # string. Certificate (P12) password. 
  # Advanced
    keychain: 'temp' # 'default' | 'temp' | 'custom'. Required. Keychain. Default: temp.
    #keychainPassword: # string. Required when keychain = custom || keychain = default. Keychain password. 
    #customKeychainPath: # string. Required when keychain = custom. Custom keychain path. 
    #deleteCert: # boolean. Optional. Use when keychain = custom || keychain = default. Delete certificate from keychain. 
    #deleteCustomKeychain: # boolean. Optional. Use when keychain = custom. Delete custom keychain. 
    #signingIdentity: # string. Certificate signing identity.

輸入

certSecureFile - 憑證 (P12)
string。 必須的。

指定上傳至 Secure Files 以安裝在macOS代理程式的憑證 (.p12)。


certPwd - 憑證 (P12) 密碼
string

指定 Apple 憑證的密碼 (.p12)。 使用新的組建變數,並在 [Variables] 索引標籤上啟用其鎖定,以加密此值。


keychain - Keychain
string。 必須的。 允許的值:default(預設金鑰鏈)、temp(暫存密鑰鏈)、custom(自定義密鑰鏈)。 預設值:temp

指定要在其中安裝Apple 憑證的金鑰鏈。 針對Microsoft裝載的組建,請使用 Temporary Keychain。 建置或發行完成後,一律會刪除暫存密鑰鏈。


keychainPassword - 金鑰鏈密碼
stringkeychain = custom || keychain = default時為必要項。

指定要解除鎖定金鑰鏈的密碼。 使用新的組建變數,並在 [Variables] 索引標籤上啟用其鎖定,以加密此值。 如果未指定,則會為暫存密鑰鏈產生密碼。


customKeychainPath - 自定義金鑰鏈路徑
stringkeychain = custom時為必要項。

指定自訂金鑰鏈檔案的完整路徑。 如果金鑰鏈不存在,則會建立金鑰鏈。


deleteCert - 從金鑰鏈刪除憑證
boolean。 選擇性。 keychain = custom || keychain = default時使用 。

指定要在建置或發行完成後從金鑰鏈中刪除的憑證。


deleteCustomKeychain - 刪除自定義金鑰鏈
boolean。 選擇性。 keychain = custom時使用 。

指定要在組建或發行完成後從代理程序刪除的自定義金鑰鏈。


signingIdentity - 憑證簽署身分識別
string

指定簽署憑證中主體的 Common Name。 如果保留空白,則會嘗試剖析 Common Name


setUpPartitionIdACLForPrivateKey - 為匯入的私鑰設定partition_id ACL
boolean

如果 true,請為匯入的私鑰設定 partition_id ACL,讓 codesign 不會提示使用金鑰進行簽署。 MacOS High Sierra 上的暫存密鑰鏈不需要這樣做。 深入瞭解 Open Radar


PKCS12opensslPkcsArgs - OpenSSL 自變數
string

使用 openssl 擷取憑證資訊的自變數。


工作控制選項

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

輸出變數

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

signingIdentity
指定簽署憑證中主體的已解析 Common Name。 提供做為輸入,或從 P12 憑證檔案剖析。

keychainPath
使用憑證指定金鑰鏈檔案的路徑。

備註

使用此工作來安裝在 macOS 代理程式上建置所需的 Apple 憑證。 您可以使用這項工作來安裝儲存為伺服器上 安全檔案 的 Apple 憑證。

需求

要求 說明
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
需求 自我裝載代理程式必須具備 功能, 符合下列 需求, 執行使用此工作的作業: xcode
功能 此工作不符合作業中後續工作的任何需求。
命令限制 此工作會使用下列 命令限制執行: 受限制
Settable 變數 此工作有權 設定下列變數:signingIdentity、keychainPassword、keychainPath、APPLE_CERTIFICATE_SIGNING_IDENTITY、APPLE_CERTIFICATE_KEYCHAIN
代理程式版本 2.182.1 或更新
工作類別 效用
要求 說明
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
需求 自我裝載代理程式必須具備 功能, 符合下列 需求, 執行使用此工作的作業: xcode
功能 此工作不符合作業中後續工作的任何需求。
命令限制 任意
Settable 變數 任意
代理程式版本 2.116.0 或更新
工作類別 效用