4.2. Creating the global Repository custom resource
Optionally, you can create a global Repository custom resource (CR) in the namespace where OpenShift Pipelines is installed, normally openshift-pipelines. If you create this CR, the settings that you specify in it apply by default to all Repository CRs that you create.
The global Repository CR is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Prerequisites
-
You have administrator access to the
openshift-pipelinesnamespace. -
You logged on to the OpenShift cluster using the
occommand line utility.
Procedure
Create a
RepositoryCR namedpipeline-as-codein theopenshift-pipelinesnamespace. Specify all the required default settings in this CR.Example command to create the CR
$ cat <<EOF|oc create -n openshift-pipelines -f - apiVersion: "pipelinesascode.tekton.dev/v1alpha1" kind: Repository metadata: name: pipelines-as-code spec: git_provider: secret: name: "gitlab-webhook-config" key: "provider.token" webhook_secret: name: "gitlab-webhook-config" key: "webhook.secret" EOFIn this example, all
RepositoryCRs that you create include the common secrets for accessing your GitLab repositories. You can set different repository URLs and other settings in the CRs.