|
| 1 | +// This module is included in the following assemblies: |
| 2 | +// * create/remote-pipelines-tasks-resolvers.adoc |
| 3 | +// * openshift_pipelines/remote-pipelines-tasks-resolvers.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="op-resolver-git-config-multiple-providers_{context}"] |
| 7 | += Configuring multiple Git providers |
| 8 | + |
| 9 | +You can configure multiple Git providers, or you can add multiple configurations for the same Git provider, to use in different task runs and pipeline runs. |
| 10 | + |
| 11 | +Add details in the `TektonConfig` custom resource (CR) with your unique identifier key prefix. |
| 12 | + |
| 13 | +.Procedure |
| 14 | + |
| 15 | +. Edit the `TektonConfig` CR by running the following command: |
| 16 | ++ |
| 17 | +[source,terminal] |
| 18 | +---- |
| 19 | +$ oc edit TektonConfig config |
| 20 | +---- |
| 21 | + |
| 22 | +. In the `TektonConfig` CR, edit the `pipeline.git-resolver-config` spec: |
| 23 | ++ |
| 24 | +[source,yaml] |
| 25 | +---- |
| 26 | +apiVersion: operator.tekton.dev/v1alpha1 |
| 27 | +kind: TektonConfig |
| 28 | +metadata: |
| 29 | + name: config |
| 30 | +spec: |
| 31 | +# ... |
| 32 | + pipeline: |
| 33 | + git-resolver-config: |
| 34 | + # configuration 1 # <1> |
| 35 | + fetch-timeout: "1m" |
| 36 | + default-url: "https://github.com/tektoncd/catalog.git" |
| 37 | + default-revision: "main" |
| 38 | + scm-type: "github" |
| 39 | + server-url: "" |
| 40 | + api-token-secret-name: "" |
| 41 | + api-token-secret-key: "" |
| 42 | + api-token-secret-namespace: "default" |
| 43 | + default-org: "" |
| 44 | + # configuration 2 # <2> |
| 45 | + test1.fetch-timeout: "5m" |
| 46 | + test1.default-url: "" |
| 47 | + test1.default-revision: "stable" |
| 48 | + test1.scm-type: "github" |
| 49 | + test1.server-url: "api.internal-github.com" |
| 50 | + test1.api-token-secret-name: "test1-secret" |
| 51 | + test1.api-token-secret-key: "token" |
| 52 | + test1.api-token-secret-namespace: "test1" |
| 53 | + test1.default-org: "tektoncd" |
| 54 | + # configuration 3 # <3> |
| 55 | + test2.fetch-timeout: "10m" |
| 56 | + test2.default-url: "" |
| 57 | + test2.default-revision: "stable" |
| 58 | + test2.scm-type: "gitlab" |
| 59 | + test2.server-url: "api.internal-gitlab.com" |
| 60 | + test2.api-token-secret-name: "test2-secret" |
| 61 | + test2.api-token-secret-key: "pat" |
| 62 | + test2.api-token-secret-namespace: "test2" |
| 63 | + test2.default-org: "tektoncd-infra" |
| 64 | +# ... |
| 65 | +---- |
| 66 | +<1> The default configuration to use if no `configKey` key is provided or the key is provided with the `default` value. |
| 67 | +<2> The configuration used if the `configKey` key is passed with the `test1` value. |
| 68 | +<3> The configuration used if the `configKey` key is passed with the `test2` value. |
| 69 | ++ |
| 70 | +[WARNING] |
| 71 | +==== |
| 72 | +`configKey` values with the `.` symbol are not supported. If you try to pass a `configKey` value that contains the `.` symbol, the `TaskRun` or `PipelineRun` resource where you passed the value fails to run. |
| 73 | +==== |
0 commit comments