diff --git a/docs/modules/ROOT/pages/advanced-how-tos/accessing-private-repositories.adoc b/docs/modules/ROOT/pages/advanced-how-tos/accessing-private-repositories.adoc new file mode 100644 index 00000000..e1584462 --- /dev/null +++ b/docs/modules/ROOT/pages/advanced-how-tos/accessing-private-repositories.adoc @@ -0,0 +1,71 @@ += Access Pipelines and Tasks in Private Repositories + +Integration Test Scenarios point to their corresponding pipeline with a link:https://tekton.dev/docs/pipelines/git-resolver/[Git Resolver]. The Git Resolver schema is inherited from Tekton and functions in the same way. Users should create an access token for their repository in link:https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens[Github] or link:https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html[Gitlab] then store that token in a secret in their namespace. + +Once this is done, the Resolver should be updated with the fields `token` and `tokenKey`, which provide the name of the secret and the key within that secret in which the access token is stored. + +== Example of Resolver in IntegrationTestScenario + +[source,yaml] +.its.yaml + +---- +apiVersion: appstudio.redhat.com/v1beta2 +kind: IntegrationTestScenario +metadata: + name: example-pass + namespace: default +spec: + application: application-sample + contexts: + - description: Application testing + name: application + resolverRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/sample-private-repo + - name: revision + value: main + - name: pathInRepo + value: pipelines/integration_pipeline_pass.yaml + - name: token + value: my-token-secret + - name: tokenKey + value: password +---- + +== Example of Resolver in Pipeline + +This is an example of how tasks in private repos can be accessed with the Git Resolver using the same method as above. + +[source,yaml] +.pipeline.yaml + +---- +apiVersion: tekton.dev/v1 +kind: Pipeline +metadata: + name: deploy-and-test +spec: + description: | + Demonstrates the use of Git Resolvers to access tasks in private repos + tasks: + - name: parse-metadata + taskRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/sample-private-repo + - name: revision + value: main + - name: pathInRepo + value: tasks/test_metadata.yaml + - name: token + value: my-token-secret + - name: tokenKey + value: password + params: + - name: SNAPSHOT + value: $(params.SNAPSHOT) +----