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

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

安裝在 macOS 代理程式上建置所需的 Apple 憑證。

Syntax

# 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.
# Install Apple Certificate v2
# Install an Apple certificate required to build on a macOS agent.
- 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 - 鑰匙
string. 必要。 允許的值: default (預設金鑰鏈) 、 temp (暫存金鑰鏈) 、 custom (自訂金鑰鏈) 。 預設值:temp

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


keychainPassword - Keychain 密碼
string. 當 keychain = custom || keychain = default 時為必要。

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


customKeychainPath - 自訂金鑰鏈路徑
string. 當 keychain = custom 時為必要。

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


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

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


deleteCustomKeychain - 刪除自訂金鑰鏈
boolean. 選擇性。 使用 時機 keychain = custom

指定要在建置或發行完成後從代理程式刪除的自訂金鑰鏈。


signingIdentity - 憑證簽署身分識別
string.

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


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

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


opensslPkcsArgs - PKCS12 的 OpenSSL 引數
string.

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


工作控制選項

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

輸出變數

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

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

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

備註

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

規格需求

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