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 - 密钥链
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 上的临时密钥链不需要这样做。 详细了解 开放雷达


opensslPkcsArgs - PKCS12 的 OpenSSL 参数
string

使用 openssl 提取证书信息的参数。


任务控制选项

除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性

输出变量

此任务定义以下 输出变量,可以在下游步骤、作业和阶段中使用。

signingIdentity
指定签名证书中使用者的已解析 Common Name。 作为输入提供,或从 P12 证书文件进行分析。

keychainPath
指定带证书的密钥链文件的路径。

注解

使用此任务安装在 macOS 代理上生成的 Apple 证书。 可以使用此任务来安装存储在服务器上的 安全文件 的 Apple 证书。

要求

要求 说明
管道类型 YAML,经典版本,经典版本
运行时间 代理,DeploymentGroup
需求 自承载代理必须具有与以下 要求 运行使用此任务的作业 功能:
功能 此任务不满足作业中后续任务的任何要求。
命令限制 此任务使用以下 命令限制运行: 受限
Settable 变量 此任务有权 设置以下变量:signingIdentity、keychainPassword、keychainPath、APPLE_CERTIFICATE_SIGNING_IDENTITY、APPLE_CERTIFICATE_KEYCHAIN
代理版本 2.182.1 或更高版本
任务类别 效用
要求 说明
管道类型 YAML,经典版本,经典版本
运行时间 代理,DeploymentGroup
需求 自承载代理必须具有与以下 要求 运行使用此任务的作业 功能:
功能 此任务不满足作业中后续任务的任何要求。
命令限制 任何
Settable 变量 任何
代理版本 2.116.0 或更高版本
任务类别 效用