GitRepository Custom Resource

2 minute read
On this page

The GitRepository Custom Resource configures a repository for integration with CloudBees Previews. It also contains repository-specific configuration information.


The GitRepository contains the following information.

Example GitRepository Custom Resource
kind: GitRepository
  name: acme-web                                (1)
  url:     (2)
    name: github-token                          (3)
    name: webhook-secret                        (4)
    name: tls-secret                            (5)
    - name: imagepull-secret                    (6)
  secretRefs:                                   (7)
    - name: db-secret                           (8)
      key:  previews-dev-db-secret              (9)
        - name: password                        (10)
          key: password                         (11)
  env:                                          (12)
    - name: CUSTOM_VAR
      value: CUSTOM_VALUE
  autoCreateContexts:                           (13)
  - default
  autoUpdateContexts:                           (14)
  - default
1 Name of the GitRepository resource.
2 HTTPS Git URL for the repository this resource configures.
3 Name of the Kubernetes Secret containing the SCM provider authentication token needed to interact with the Git repository specified in url.
4 Name of the Kubernetes Secret containing the secret for verifying webhook payloads.
5 Name of the TLS secret for environment ingresses for this repository. This value has precedence over the globally specified TLS secret in the Helm chart. See also TLS configuration via Helm chart.
6 List of image pull secret names.
7 List of secrets developers are allowed to use within previews by referring to them via the expression language within their .preview.yaml file. See also Using custom secrets.
8 The name under which the secret is made available within .preview.yaml.
9 The name of a Kubernetes Secret in the CloudBees Previews installation namespace from which to retrieve the values for the secret.
10 The identifier that can be used to refer to the secret within .preview.yaml.
11 The key within the Kubernetes Secret.
12 List of custom environment variables passed to each step of the environment creation process.
13 Configuration to enable automatic creation of preview environments. The autoCreateContexts configuration takes a list of preview contexts for which to enable auto-creation.
14 Configuration to enable automatic updates of preview environments. The autoUpdateContexts configuration takes a list of preview contexts for which to enable auto-updates. By default, you must explicitly request a preview using the /preview comment on the pull request. You must repeat the comment each time you update the pull request. With autoUpdateContexts, you can list the preview contexts for which only an initial preview comment is necessary. Preview environments for the specified contexts will be created automatically with each subsequent push to the pull request.