Authenticating into a Git repository
For this first hands-on example, you will start by creating a private repository in GitHub. Once this Git repository is ready, you will create a Secret object in Kubernetes. This object will contain your credentials and will be assigned to a service account. Using this specific service account in your runs, you will be able to clone a private repository.
For the following examples, you will need a private GitHub repository with a README.md
file and the credentials for it.
Once you have a private repository in place, you can create the following task in a file named task.yaml
. This task will use the alpine/git
image to clone a repository and output the content of the README.md
file:
apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: read-file spec: params: - name: private-repo type: string steps: - name: clone image: alpine...