Beatrice Klee 克隆一个项目

Bitrise CLI clone a project

我正在尝试设置 BITRISE CLI,但无法使用 BITRISE CLI 下载项目源代码。我如何在我的本地机器上使用 bitrise cli 克隆我在 git hub 中托管的项目?

Bitrise CLI 旨在以两种不同的方式使用:

  • 在 CI 环境中使用它,检索代码应该是该过程的一部分。
  • 在您已有代码的本地 Mac/PC 上使用它,因此无需检索它。

如果您安装了 CLI 并且 bitrise run 在您的 Mac/PC 上,那么它会 运行 在第二种模式下,它期望您已经有您的代码,所以相关的将跳过步骤。

在 CI 环境中,或者如果您想自己强制执行 "CI mode" Mac/PC,您应该将 CI 环境变量设置为 true 在 运行 bitrise cli 之前。 CLI 还有一个命令行标志选项,可用于激活此模式:

$ bitrise --help

NAME: bitrise - Bitrise Automations Workflow Runner

USAGE: bitrise [OPTIONS] COMMAND/PLUGIN [arg...]

VERSION: 1.16.1

GLOBAL OPTIONS:
  --loglevel value, -l value  Log level (options: debug, info, warn, error, fatal, panic). [$LOGLEVEL]
  --debug                     If true it enabled DEBUG mode. If no separate Log Level is specified this will also set the loglevel to debug. [$DEBUG]
  --ci                        If true it indicates that we're used by another tool so don't require any user input! [$CI]
  --pr                        If true bitrise runs in pull request mode.
  --help, -h                  show help
  --version, -v               print the version
...

如您所见,--ci 标志可用于启用此模式(例如 bitrise --ci run ...),以及 CI 环境变量。

当您 运行 Bitrise CLI 处于 CI 模式时,它会简单地将 .IsCI run_if 条件设置为 true,否则在非 CI 模式是 false。这意味着,有一些步骤利用了这个标志,并且在 CI 模式下被默认标记为 到仅 运行 - 例如参见 [​​= 72=] 克隆步骤的定义:https://github.com/bitrise-io/steps-git-clone/blob/13fc7d29662bc68aaead618a72d499fb0f031d6c/step.yml#L18

您当然可以在自己的 bitrise.yml 中覆盖此 run_if,它只是 默认 配置。

因此,另一种在任何环境中强制执行 运行 的方法是在 bitrise.yml 中用 run_if: true 标记它。

相关链接: