cicd-integrations
2025.10
true
CI/CD 集成用户指南
- 概述
- UiPath CLI
- Azure DevOps 扩展程序
- Jenkins 插件
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
恢复自动化依赖项
使用 CLI 恢复自动化依赖项的先决条件和步骤。
先决条件
- 创建外部应用程序。
- 运行 CLI
exe(对于 Windows 旧版)或dll(对于 Windows/Linux/macOS)文件。 - 添加所需的 Orchestrator API 访问应用程序作用域。
要恢复依赖项,请执行以下步骤:
-
使用
uipcli package运行package任务。您可以注意可用子任务的列表。 -
指定所需参数并运行
restore子任务。下表描述了必需参数:
参数 描述 Project(s) Path (pos. 0)必填。 project.json文件的路径或包含project.json文件的文件夹的路径。--restoreFolder必填。 还原目标文件夹路径。 --nugetConfigFilePath可选。还原期间使用的 NuGet.Config文件的路径。从 2018 年 10 月 25 日起,文件将遵循端到端流程 —<clear />、<packageSourceCredentials>、<packageSourceMapping>和<fallbackPackageFolders>都会生效。请参阅管理 NuGet 订阅源。在较旧的版本中,仅应用了<packageSources>URL。--disableBuiltInNugetFeeds禁用内置 NuGet 订阅源。 --excludeConfiguredSources可选。不包括内置订阅源以及在运行 CLI 的主机上在用户和计算机级别配置的 NuGet 源。CLI 仅解析 --nugetConfigFilePath中定义的订阅源中的包。请参阅管理 NuGet 订阅源。-u,--libraryOrchestratorUsername可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 用于身份验证的 Orchestrator 用户名。 必须与密码一起使用。 -p,--libraryOrchestratorPassword可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 用于身份验证的 Orchestrator 密码。 必须与用户名一起使用。 -t,--libraryOrchestratorAuthToken可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 用于身份验证的 Orchestrator 刷新令牌。 必须与组织名称和客户端 ID 一起使用。 -a,--libraryOrchestratorAccountName可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 Orchestrator 组织名称。 必须与刷新令牌和客户端 ID 一起使用。 -A,--libraryOrchestratorAccountForApp可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 Orchestrator 组织名称。 必须与外部应用程序的 ID、密码和作用域一起使用。 -I,--libraryOrchestratorApplicationId可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 外部应用程序 ID。 必须与外部应用程序的组织名称、密码和作用域一起使用。 -S,--libraryOrchestratorApplicationSecret可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 外部应用程序密码。 必须与外部应用程序的组织名称、ID 和作用域一起使用。 --libraryOrchestratorApplicationScope可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 以空格分隔的应用程序作用域列表。 必须与外部应用程序的组织名称、ID 和密码一起使用。 --libraryOrchestratorUrl可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 Orchestrator URL。 --libraryOrchestratorTenant可选,仅当您具有来自 Orchestrator 中的库的依赖项时有用。 Orchestrator 租户。 --libraryIdentityUrl身份服务器的 URL。当库 Orchestrator 在UiPath Automation Suite或独立 Orchestrator (内部部署 MSI)上运行时为必需。Automation Cloud不需要 — CLI 从云 URL 解析身份服务器。 --traceLevel指定要输出以下值之一的日志消息类型: None、Critical、Error、Warning、Information、Verbose。 默认值:“信息”。 -l,--language已翻译日志的语言。 --ca-cert验证 Orchestrator 和 Identity Server TLS 证书时使用的一个或多个受信任的根 CA 证书文件(PEM、DER 或 PKCS#7)。重复标记或用逗号分隔多个路径。有关详细信息,请参阅信任自定义证书。 --pinnedpubkey固定服务器叶证书的公钥。格式: sha256//<base64>。除标准证书验证以外进行检查。有关详细信息,请参阅信任自定义证书。
备注:
在不指定--libraryOrchestratorApplicationScope参数的情况下使用外部应用程序身份验证时,CLI 会自动应用这些默认的 Orchestrator 作用域:
OR.Assets OR.BackgroundTasks OR.Execution OR.Folders OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read
提示:
对于私有证书颁发机构签名的 Orchestrator 实例(例如 UiPath Automation Suite),此命令也接受--ca-cert和--pinnedpubkey参数。有关场景和示例,请参阅信任自定义证书。
用法
uipcli package restore <project_path> --restoreFolder <restore_directory> --nugetConfigFilePath <nuget_config_path> [--libraryOrchestratorUrl <orchestrator_url> --libraryOrchestratorTenant <orchestrator_tenant>] [--u <orchestrator_user> --p <orchestrator_pass>] [--t <auth_token> --a <account_name>] [-A <organization_name> -I <application_id> -S <application_secret> --libraryOrchestratorApplicationScope <application_scope>] [--libraryIdentityUrl <identity_url>] [--libraryOrchestratorFolder <folder_name>] [-l <language>] [--disableBuiltInNugetFeeds] [--excludeConfiguredSources] [--traceLevel <None|Critical|Error|Warning|Information|Verbose>]
uipcli package restore <project_path> --restoreFolder <restore_directory> --nugetConfigFilePath <nuget_config_path> [--libraryOrchestratorUrl <orchestrator_url> --libraryOrchestratorTenant <orchestrator_tenant>] [--u <orchestrator_user> --p <orchestrator_pass>] [--t <auth_token> --a <account_name>] [-A <organization_name> -I <application_id> -S <application_secret> --libraryOrchestratorApplicationScope <application_scope>] [--libraryIdentityUrl <identity_url>] [--libraryOrchestratorFolder <folder_name>] [-l <language>] [--disableBuiltInNugetFeeds] [--excludeConfiguredSources] [--traceLevel <None|Critical|Error|Warning|Information|Verbose>]
最少命令示例
uipcli package restore "C:\userprofile\AutomationProject" --traceLevel Information --restoreFolder ""C:\userprofile\DependencyPackages" --nugetConfigFilePath "C:\userprofile\Package\NuGet.Config"uipcli package restore "C:\userprofile\AutomationProject" --traceLevel Information --restoreFolder "C:\userprofile\DependencyPackages" --libraryOrchestratorUrl "https://orch-23-10-paas.cloudapp.azure.com/" --libraryOrchestratorTenant "TenantName" -u "orchestratorUsername" -p "********" --orchestratorFolder "FolderName"uipcli package restore "C:\userprofile\AutomationProject" --traceLevel Information --restoreFolder "C:\userprofile\DependencyPackages" --libraryOrchestratorUrl "https://orch-23-10-paas.cloudapp.azure.com/" --libraryOrchestratorTenant "TenantName" -A "organizationName" -I "76000552-3e4f-4590-9317-cdb420001f1d" -S '********' --libraryOrchestratorApplicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" --libraryOrchestratorFolder "FolderName" --libraryIdentityUrl "https://orch-23-10-paas.cloudapp.azure.com/identity"uipcli package restore "C:\userprofile\AutomationProject" --traceLevel Information --restoreFolder "C:\userprofile\DependencyPackages" --libraryOrchestratorUrl "https://automation-suite.base.url.com/" --libraryOrchestratorTenant "TenantName" -A "organizationName" -I "3f6239b9-e0e8-465e-a429-d9ffd1d9e57a" -S '********' --libraryOrchestratorApplicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" --libraryOrchestratorFolder "FolderName"uipcli package restore "C:\userprofile\AutomationProject" --traceLevel Information --restoreFolder "C:\userprofile\DependencyPackages" --libraryOrchestratorUrl "https://cloud.uipath.com/" --libraryOrchestratorTenant "TenantName" -A "organizationName" -I "becc663c-8f1e-409a-a75f-c00330d80bc8" -S '********' --libraryOrchestratorApplicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" --libraryOrchestratorFolder "FolderName"
隔离还原 — 仅从显式 nuget.config 解析依赖项
uipcli package restore "C:\userprofile\AutomationProject" --traceLevel Information --restoreFolder "C:\userprofile\DependencyPackages" --nugetConfigFilePath "C:\ci\nuget.config" --excludeConfiguredSources