UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

CI/CD 秘钥:GitLab CI

完整的 GitLab CI 管道,用于在多个租户之间对 UiPath 解决方案进行身份验证、打包、发布、部署以及运行测试。

此页为您提供完整的.gitlab-ci.yml ,用于安装 CLI,使用外部应用程序进行身份验证,打包并发布 UiPath 解决方案,将其部署到跨多个租户的 Orchestrator(通过矩阵),并运行 Test Manager 套件。将其拖放到存储库的根目录中,设置三个 CI/CD 变量,然后它就会运行。

有关基本原则(身份验证、缓存、工具预安装、版本固定),请参阅操作方法:从 CI 部署到 Orchestrator 。本页面重点介绍 GitLab 语法,包括 GitLab 特定功能(具有键定作用域的缓存, parallel: matrix )。

先决条件​

在复制以下 YAML 之前:

  1. 在 UiPath 中使用管道所需的OR.*作用域创建外部应用程序。请参阅身份验证 — 流程2 。
  2. 将密码存储为 CI/CD 变量:
    • 项目→设置→CI/CD→变量。
    • 添加UIPATH_CLIENT_ID和UIPATH_CLIENT_SECRET 。将两者标记为“已掩码”和“已保护” (因此它们仅在受保护的分支/标签上公开)。
    • 添加UIPATH_TENANT_DEV 、 UIPATH_TENANT_STAGE 、 UIPATH_TENANT_PROD以及租户名称(未掩码 — 租户名称不敏感)。
  3. Commit a frozen .uipath/config.json at the repository root. The pipeline reads the CLI, tool, and skills versions from it. See Freezing a CI pipeline.
  4. 如果您需要测试作业,请配置 Test Manager 项目和测试集。将TEST_SET_KEY和PROJECT_KEY添加为常规变量。

.gitLab-ci.yml​

# -----------------------------------------------------------------------------
# Deploy UiPath Solution
# -----------------------------------------------------------------------------
# Auth: External Application, env.VAR_NAME prefix (never the literal value).
# Cache: npm global node_modules, keyed by the frozen .uipath/config.json.
# Matrix: deploy job fans out across dev / stage / prod tenants.
# -----------------------------------------------------------------------------

image: node:22

stages:
  - build
  - deploy
  - test

variables:
  SOLUTION_NAME: 'my-solution'
  DEPLOYMENT_NAME: 'my-solution'   # the deployment's identity: keep it the same on every run
  SOLUTION_DIR:  './my-solution'
  OUTPUT_DIR:    './dist'
  SOLUTION_VERSION: '1.2.0-ci.$CI_PIPELINE_IID'

  # Workspace-local npm prefix so installs need no sudo and are cacheable.
  NPM_PREFIX: "$CI_PROJECT_DIR/.npm-global"

# Re-usable install block. GitLab does not have anchors for script:; we use
# YAML anchors on a hidden job and extend from it.
.install-uip: &install-uip |
  set -euo pipefail
  mkdir -p "$NPM_PREFIX"
  npm config set prefix "$NPM_PREFIX"
  export PATH="$NPM_PREFIX/bin:$PATH"

  CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
  if ! command -v uip >/dev/null; then
    npm install -g "@uipath/cli@$CLI_PIN"
  fi
  uip update
  uip --version

cache:
  key:
    files:
      - .uipath/config.json
    prefix: uip
  paths:
    - .npm-global/lib/node_modules
  policy: pull-push

# -----------------------------------------------------------------------------
# Stage: build
# -----------------------------------------------------------------------------

pack:
  stage: build
  script:
    - *install-uip
    - mkdir -p "$OUTPUT_DIR"
    - |
      uip solution pack "$SOLUTION_DIR" "$OUTPUT_DIR" \
        --name "$SOLUTION_NAME" \
        --version "$SOLUTION_VERSION"
  artifacts:
    paths:
      - "$OUTPUT_DIR/*.zip"
    expire_in: 30 days

# -----------------------------------------------------------------------------
# Stage: deploy — matrix across environments
# -----------------------------------------------------------------------------

deploy:
  stage: deploy
  needs:
    - job: pack
      artifacts: true
  parallel:
    matrix:
      - ENVIRONMENT: dev
        TENANT_VAR:  UIPATH_TENANT_DEV
      - ENVIRONMENT: stage
        TENANT_VAR:  UIPATH_TENANT_STAGE
      - ENVIRONMENT: prod
        TENANT_VAR:  UIPATH_TENANT_PROD
  environment:
    name: uipath/$ENVIRONMENT
  rules:
    # Protected branches only — set protection under Settings → Repository.
    - if: '$CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    - when: on_success
  script:
    - *install-uip
    - |
      # Resolve the per-environment tenant from the matrix variable.
      UIPATH_TENANT="${!TENANT_VAR}"
      if [ -z "$UIPATH_TENANT" ]; then
        echo "Tenant variable $TENANT_VAR is empty; set it in CI/CD settings." >&2
        exit 3
      fi

      uip login \
        --client-id env.UIPATH_CLIENT_ID \
        --client-secret env.UIPATH_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT"

      ARTIFACT=$(find "$OUTPUT_DIR" -maxdepth 1 -name "*.zip" | head -1)
      uip solution publish "$ARTIFACT"

      uip solution deploy run \
        --name "$DEPLOYMENT_NAME-$ENVIRONMENT" \
        --package-name "$SOLUTION_NAME" \
        --package-version "$SOLUTION_VERSION" \
        --folder-name MySolution \
        --parent-folder-path Shared

# -----------------------------------------------------------------------------
# Stage: test
# -----------------------------------------------------------------------------

test:
  stage: test
  needs:
    - job: "deploy: [dev, UIPATH_TENANT_DEV]"   # depend on the dev leg of the matrix
      optional: true
  rules:
    - if: '$CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    - if: '$TEST_SET_KEY == null || $TEST_SET_KEY == ""'
      when: never
    - when: on_success
  script:
    - *install-uip
    - |
      uip login \
        --client-id env.UIPATH_CLIENT_ID \
        --client-secret env.UIPATH_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT_DEV"

      EXECUTION_ID=$(uip tm testsets run \
        --test-set-key "$TEST_SET_KEY" \
        --output-filter "ExecutionId" \
        --output plain)

      echo "started execution $EXECUTION_ID"

      code=0
      uip tm wait \
        --execution-id "$EXECUTION_ID" \
        --project-key "$PROJECT_KEY" \
        --timeout 1800 || code=$?

      if [ "$code" -eq 4 ]; then
        echo "test run did not finish within 30 minutes" >&2
        exit 4
      fi

      uip tm report get \
        --execution-id "$EXECUTION_ID" \
        --project-key "$PROJECT_KEY"

      FAILED=$(uip tm report get \
        --execution-id "$EXECUTION_ID" \
        --project-key "$PROJECT_KEY" \
        --output-filter "Failed" \
        --output plain)

      if [ "$FAILED" -gt 0 ]; then
        echo "$FAILED test case(s) failed" >&2
        exit 1
      fi

      if [ "$code" -ne 0 ]; then
        echo "wait failed or the run was cancelled (exit $code)" >&2
        exit "$code"
      fi
# -----------------------------------------------------------------------------
# Deploy UiPath Solution
# -----------------------------------------------------------------------------
# Auth: External Application, env.VAR_NAME prefix (never the literal value).
# Cache: npm global node_modules, keyed by the frozen .uipath/config.json.
# Matrix: deploy job fans out across dev / stage / prod tenants.
# -----------------------------------------------------------------------------

image: node:22

stages:
  - build
  - deploy
  - test

variables:
  SOLUTION_NAME: 'my-solution'
  DEPLOYMENT_NAME: 'my-solution'   # the deployment's identity: keep it the same on every run
  SOLUTION_DIR:  './my-solution'
  OUTPUT_DIR:    './dist'
  SOLUTION_VERSION: '1.2.0-ci.$CI_PIPELINE_IID'

  # Workspace-local npm prefix so installs need no sudo and are cacheable.
  NPM_PREFIX: "$CI_PROJECT_DIR/.npm-global"

# Re-usable install block. GitLab does not have anchors for script:; we use
# YAML anchors on a hidden job and extend from it.
.install-uip: &install-uip |
  set -euo pipefail
  mkdir -p "$NPM_PREFIX"
  npm config set prefix "$NPM_PREFIX"
  export PATH="$NPM_PREFIX/bin:$PATH"

  CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli") || exit 1
  if ! command -v uip >/dev/null; then
    npm install -g "@uipath/cli@$CLI_PIN"
  fi
  uip update
  uip --version

cache:
  key:
    files:
      - .uipath/config.json
    prefix: uip
  paths:
    - .npm-global/lib/node_modules
  policy: pull-push

# -----------------------------------------------------------------------------
# Stage: build
# -----------------------------------------------------------------------------

pack:
  stage: build
  script:
    - *install-uip
    - mkdir -p "$OUTPUT_DIR"
    - |
      uip solution pack "$SOLUTION_DIR" "$OUTPUT_DIR" \
        --name "$SOLUTION_NAME" \
        --version "$SOLUTION_VERSION"
  artifacts:
    paths:
      - "$OUTPUT_DIR/*.zip"
    expire_in: 30 days

# -----------------------------------------------------------------------------
# Stage: deploy — matrix across environments
# -----------------------------------------------------------------------------

deploy:
  stage: deploy
  needs:
    - job: pack
      artifacts: true
  parallel:
    matrix:
      - ENVIRONMENT: dev
        TENANT_VAR:  UIPATH_TENANT_DEV
      - ENVIRONMENT: stage
        TENANT_VAR:  UIPATH_TENANT_STAGE
      - ENVIRONMENT: prod
        TENANT_VAR:  UIPATH_TENANT_PROD
  environment:
    name: uipath/$ENVIRONMENT
  rules:
    # Protected branches only — set protection under Settings → Repository.
    - if: '$CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    - when: on_success
  script:
    - *install-uip
    - |
      # Resolve the per-environment tenant from the matrix variable.
      UIPATH_TENANT="${!TENANT_VAR}"
      if [ -z "$UIPATH_TENANT" ]; then
        echo "Tenant variable $TENANT_VAR is empty; set it in CI/CD settings." >&2
        exit 3
      fi

      uip login \
        --client-id env.UIPATH_CLIENT_ID \
        --client-secret env.UIPATH_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT"

      ARTIFACT=$(find "$OUTPUT_DIR" -maxdepth 1 -name "*.zip" | head -1)
      uip solution publish "$ARTIFACT"

      uip solution deploy run \
        --name "$DEPLOYMENT_NAME-$ENVIRONMENT" \
        --package-name "$SOLUTION_NAME" \
        --package-version "$SOLUTION_VERSION" \
        --folder-name MySolution \
        --parent-folder-path Shared

# -----------------------------------------------------------------------------
# Stage: test
# -----------------------------------------------------------------------------

test:
  stage: test
  needs:
    - job: "deploy: [dev, UIPATH_TENANT_DEV]"   # depend on the dev leg of the matrix
      optional: true
  rules:
    - if: '$CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    - if: '$TEST_SET_KEY == null || $TEST_SET_KEY == ""'
      when: never
    - when: on_success
  script:
    - *install-uip
    - |
      uip login \
        --client-id env.UIPATH_CLIENT_ID \
        --client-secret env.UIPATH_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT_DEV"

      EXECUTION_ID=$(uip tm testsets run \
        --test-set-key "$TEST_SET_KEY" \
        --output-filter "ExecutionId" \
        --output plain)

      echo "started execution $EXECUTION_ID"

      code=0
      uip tm wait \
        --execution-id "$EXECUTION_ID" \
        --project-key "$PROJECT_KEY" \
        --timeout 1800 || code=$?

      if [ "$code" -eq 4 ]; then
        echo "test run did not finish within 30 minutes" >&2
        exit 4
      fi

      uip tm report get \
        --execution-id "$EXECUTION_ID" \
        --project-key "$PROJECT_KEY"

      FAILED=$(uip tm report get \
        --execution-id "$EXECUTION_ID" \
        --project-key "$PROJECT_KEY" \
        --output-filter "Failed" \
        --output plain)

      if [ "$FAILED" -gt 0 ]; then
        echo "$FAILED test case(s) failed" >&2
        exit 1
      fi

      if [ "$code" -ne 0 ]; then
        echo "wait failed or the run was cancelled (exit $code)" >&2
        exit "$code"
      fi

演练​

顶级设置​

  • image: node:22 — 每个作业都在官方 Node.js 22 映像中运行。CLI 要求 Node 22+。如果您的 GitLab 运行器已安装 Node,并且您不需要容器,则可以删除其并改用 shell 执行程序。
  • variables: — 管道范围内的值。SOLUTION_VERSION对$CI_PIPELINE_IID进行插值(项目作用域内的增量管道编号 — 比$CI_JOB_ID更适合版本控制,后者是全局性的非单调元素)。
  • .install-uip anchor — GitLab does not let you anchor script: blocks directly, but you can anchor a YAML node containing a shell string and splice it in with - *install-uip. Same install guard as the other recipes: workspace-local prefix, conditional CLI install at the version in versions.cli. uip update then puts the CLI and each pinned tool on their pins. Every job has the repository by default, so the CLI finds the frozen .uipath/config.json. See Freezing a CI pipeline.
  • cache: — the key comes from .uipath/config.json (key: files) with the prefix uip, so a change to the freeze invalidates the cache cleanly. policy: pull-push reads on entry and writes on successful job exit. If you run at scale and want to shave seconds off every job, split into a dedicated "seed the cache" job that runs pull-push and have all other jobs use policy: pull only.

打包作业​

  • 通过共享锚点安装 CLI 。
  • 具有显式版本的uip solution pack — 请参阅uip solution pack 。
  • artifacts:将.zip带到下一阶段。路径为通配符$OUTPUT_DIR/*.zip路径,因此系统会选取uip solution pack生成的任何文件名。expire_in: 30 days阻止 GitLab 的工件存储无限增长;如果您需要更长的可追溯性,则可以颠倒它。

使用并行部署作业:矩阵​

矩阵展开为三个作业—— deploy: [dev, UIPATH_TENANT_DEV] 、 deploy: [stage, UIPATH_TENANT_STAGE] 、 deploy: [prod, UIPATH_TENANT_PROD] ——这三个作业并行运行。每个都具有不同的$ENVIRONMENT和$TENANT_VAR ,并使用 bash 间接扩展 ( ${!TENANT_VAR} ) 从右侧的 CI/CD 变量读取每个环境的租户。

  • environment: name: uipath/$ENVIRONMENT — GitLab 在“环境”视图中跟踪部署,因此每个租户都会获得每个环境的历史记录,并带有回滚按钮。
  • rules: — the first rule keeps every environment, prod included, away from unprotected branches. Combined with Settings → Repository → Protected branches (where you mark main protected), this is how you stop a feature branch from upgrading the shared deployments to unmerged code. To deploy feature branches, give each one its own deployment name in a test tenant: see A copy per feature branch. The UIPATH_CLIENT_* variables should also be marked Protected so they only resolve on protected refs.
  • uip login --client-id env.UIPATH_CLIENT_ID --client-secret env.UIPATH_CLIENT_SECRET — 支持使用env.VAR_NAME前缀将密码传递给 CLI,而无需密码出现在 Shell 命令行中。当标记为“掩码”时,GitLab 会掩码日志中的变量,但无论怎样, env.前缀都是一种纵深防御措施。请参阅身份验证 — env.VAR_NAME 前缀。
  • Deployment name — the deployment is keyed on --name, so $DEPLOYMENT_NAME-$ENVIRONMENT stays the same on every run into a given environment:
    • The first run into an environment creates the deployment and its folder, Shared/MySolution.
    • Every later run upgrades that same deployment in place to the new version. The folder and the provisioned resources stay, and values already set on them (for example a credential asset's secret) are kept. --folder-name and --parent-folder-path apply only to the first run.
    • Do not put $CI_PIPELINE_IID or a commit SHA in --name. Each new name is a new deployment, and because the folder name is already taken, Orchestrator creates MySolution 1, MySolution 2, and so on: one folder per run.
    • Under the client-credentials login this pipeline uses, the CLI's "already deployed" check only warns; it does not stop the job.
    • Once the deployment exists, uip solution deploy upgrade --name "$DEPLOYMENT_NAME-$ENVIRONMENT" --package-name "$SOLUTION_NAME" --version <version> does the same upgrade. Unlike deploy run, it fails when no deployment has that name, instead of creating one. See deploy upgrade.
    • If you add --config-file, keep only the resources you change in the file. Each resource the file names is applied as written on every run, so a file straight from deploy config get sets those resources back to the package defaults.
备注:

在并行矩阵作业中,如果一条分支出现故障,默认情况下其他分支会继续运行。如果您希望 Prod 等待开发和阶段,请将矩阵转换为三个连续的作业(或在它们之间使用needs: )。

测试作业​

  • needs:通过扩展名称引用矩阵分支"deploy: [dev, UIPATH_TENANT_DEV]" 。如果rules:块跳过了开发阶段,则optional: true会使依赖项成为非严重。
  • rules: skips the job on unprotected branches, which deploy nothing to dev, and when TEST_SET_KEY is unset, same pattern as the other recipes.
  • Launch → wait → verify — the canonical test pattern from How-to: run tests from the CLI. Exit 4 from uip tm wait means timeout; exit 1 means a test failed or the run was cancelled.

常见变体​

使用手动门进行序列提升​

如果您希望 Prod 需要手动单击而不是受保护的分支门控,请将矩阵拆分为三个作业,并将when: manual添加到 Prod 中:

deploy-dev:
  stage: deploy
  # …as deploy above, fixed to UIPATH_TENANT_DEV…

deploy-stage:
  stage: deploy
  needs: [ pack, deploy-dev ]
  # …as deploy above, fixed to UIPATH_TENANT_STAGE…

deploy-prod:
  stage: deploy
  needs: [ pack, deploy-stage ]
  when: manual                    # requires a reviewer to click "Play"
  allow_failure: false
  environment:
    name: uipath/prod
  # …as deploy above, fixed to UIPATH_TENANT_PROD…
deploy-dev:
  stage: deploy
  # …as deploy above, fixed to UIPATH_TENANT_DEV…

deploy-stage:
  stage: deploy
  needs: [ pack, deploy-dev ]
  # …as deploy above, fixed to UIPATH_TENANT_STAGE…

deploy-prod:
  stage: deploy
  needs: [ pack, deploy-stage ]
  when: manual                    # requires a reviewer to click "Play"
  allow_failure: false
  environment:
    name: uipath/prod
  # …as deploy above, fixed to UIPATH_TENANT_PROD…

回滚​

Trigger manually via a separate job with a pipeline variable. It uses deploy upgrade --name rather than deploy run: deploy upgrade never creates a deployment, so a mistyped name fails instead of installing a fresh copy in a new folder:

rollback:
  stage: deploy
  rules:
    - if: '$ROLLBACK_VERSION != null && $ROLLBACK_VERSION != ""'
      when: manual
  script:
    - *install-uip
    - |
      uip login \
        --client-id env.UIPATH_CLIENT_ID \
        --client-secret env.UIPATH_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT_PROD"

      uip solution deploy upgrade \
        --name "$DEPLOYMENT_NAME-prod" \
        --package-name "$SOLUTION_NAME" \
        --version "$ROLLBACK_VERSION"
rollback:
  stage: deploy
  rules:
    - if: '$ROLLBACK_VERSION != null && $ROLLBACK_VERSION != ""'
      when: manual
  script:
    - *install-uip
    - |
      uip login \
        --client-id env.UIPATH_CLIENT_ID \
        --client-secret env.UIPATH_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT_PROD"

      uip solution deploy upgrade \
        --name "$DEPLOYMENT_NAME-prod" \
        --package-name "$SOLUTION_NAME" \
        --version "$ROLLBACK_VERSION"

Start the pipeline from CI/CD → Pipelines → Run pipeline and set ROLLBACK_VERSION to the target version (for example, 1.1.9). deploy upgrade preserves the deployment's existing configuration — asset/credential values already set on it aren't reset to package defaults — and it accepts any published version of the package, including an older one. Add - if: '$ROLLBACK_VERSION' with when: never as the first rule of the deploy job as well, so a rollback pipeline does not also deploy the new build to the same deployments. For destructive rollback (uninstall + delete artifact), see How-to: pack and publish a Solution — rollback.

A copy per feature branch​

To review a feature branch, or the merge request it belongs to, on a running copy, deploy it under a name and folder of its own in a test tenant. The name stays the same for the life of the branch: its first pipeline creates the copy, and every later push updates that copy in place.

deploy-branch:
  stage: deploy
  needs:
    - job: pack
      artifacts: true
  rules:
    - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED != "true"'
  resource_group: uipath-$CI_COMMIT_REF_SLUG
  script:
    - *install-uip
    - |
      uip login \
        --client-id env.UIPATH_TEST_CLIENT_ID \
        --client-secret env.UIPATH_TEST_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT_TEST"

      ARTIFACT=$(find "$OUTPUT_DIR" -maxdepth 1 -name "*.zip" | head -1)
      uip solution publish "$ARTIFACT"

      uip solution deploy run \
        --name "$DEPLOYMENT_NAME-$CI_COMMIT_REF_SLUG" \
        --package-name "$SOLUTION_NAME" \
        --package-version "$SOLUTION_VERSION" \
        --folder-name "MySolution-$CI_COMMIT_REF_SLUG" \
        --parent-folder-path Shared \
        --yes
deploy-branch:
  stage: deploy
  needs:
    - job: pack
      artifacts: true
  rules:
    - if: '$CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED != "true"'
  resource_group: uipath-$CI_COMMIT_REF_SLUG
  script:
    - *install-uip
    - |
      uip login \
        --client-id env.UIPATH_TEST_CLIENT_ID \
        --client-secret env.UIPATH_TEST_CLIENT_SECRET \
        --tenant "$UIPATH_TENANT_TEST"

      ARTIFACT=$(find "$OUTPUT_DIR" -maxdepth 1 -name "*.zip" | head -1)
      uip solution publish "$ARTIFACT"

      uip solution deploy run \
        --name "$DEPLOYMENT_NAME-$CI_COMMIT_REF_SLUG" \
        --package-name "$SOLUTION_NAME" \
        --package-version "$SOLUTION_VERSION" \
        --folder-name "MySolution-$CI_COMMIT_REF_SLUG" \
        --parent-folder-path Shared \
        --yes
  • $CI_COMMIT_REF_SLUG in --name and --folder-name gives each branch its own deployment and its own folder, for example Shared/MySolution-feature-login. GitLab builds the slug from the branch name: lowercase letters, digits and -, at most 63 characters. --yes skips the "already deployed" check, since the test tenant is expected to hold other branches' copies of the package.
  • UIPATH_TEST_CLIENT_ID, UIPATH_TEST_CLIENT_SECRET and UIPATH_TENANT_TEST are CI/CD variables of their own, for an External Application you use with the test tenant only. Mark the client ID and secret Masked but not Protected: GitLab passes Protected variables only to protected branches, so this job could not log in with them. Never give this job the production credentials.
  • rules: runs the job on unprotected branches only. Protected branches deploy through the deploy matrix.
  • resource_group runs one deploy at a time per branch. While an operation on a deployment runs, the server refuses another deploy under that name.

跳过测试​

未设置 CI/CD 变量中的TEST_SET_KEY 。test作业的rules:块会完全跳过该作业。

常见错误​

  • 已掩码 != 受保护。掩码变量隐藏日志中的值,但仍然在所有分支(包括短期功能分支)上可用。受保护的变量仅在受保护的引用上公开。两者都需要用于身份验证密码,否则推送的功能分支可能会在生产环境中运行uip login 。
  • 间接扩展需要 bash。${!TENANT_VAR}是一项 bash 功能;某些最小映像中的默认sh不支持。默认情况下, node:22映像包含 bash;在基于alpine映像上,在显式的每个环境变量上添加apk add bash或切换到 case 语句。
  • Matrix 作业名称包含空格。needs: - job: "deploy: [dev, UIPATH_TENANT_DEV]" — 名称中包含: [ ,因此请在 YAML 中将其引用。
  • 缓存路径是相对于工作区的。缓存条目.npm-global/lib/node_modules可以正常运行,因为NPM_PREFIX="$CI_PROJECT_DIR/.npm-global"会将其放置在工作区中。如果将前缀移出,缓存将停止工作。
  • set -euo pipefail必须位于每个多行脚本的顶部。如果没有它,打包失败后可以“成功”发布过时的工件。请参阅脚本编写模式—严格 shell 选项。

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持(opens in new window)

想要了解详细内容? UiPath Academy(opens in new window)

有问题? UiPath 论坛(opens in new window)

保持更新