如何在 OpenShift 部署中指定除 master 之外的特定分支?

Avi*_*ava 2 git yaml openshift

我的目标是从 git 构建容器映像,但仅限于特定分支。为此,在 my 中build.yaml,我必须指定 git 分支的 uri:

spec:
  output:
    to:
      kind: ImageStreamTag
      name: superset-custom-exporter:latest
  source:
    git:
      uri: https://gitlab.cee.domain.com/repo-org/repo-name.git
    type: Git
Run Code Online (Sandbox Code Playgroud)

这将获取主分支,但是,我想要该superset-custom-exporter分支。我怎么做?

我尝试通过网络和命令测试某些URL [1] git clone,但都失败了。

  1. 之后添加分支名称#
  2. 使用确切的网址

Mur*_*nik 5

您可以使用该ref属性来指定分支名称(或任何其他提交):

source:
  git:
    uri: https://gitlab.cee.domain.com/repo-org/repo-name.git
    ref: superset-custom-exporter
  type: Git
Run Code Online (Sandbox Code Playgroud)