Paste secret key to the data
in the secret.yaml
.
>> cat ~/.ssh/id_rsa | base64
>> cat ~/.ssh/config | base64
>> cat ~/.ssh/known_hosts | base64
>> oc create -f secret.yaml
Register your public key to GitHub account. To register public key to go to Settings
of your GitHub account page > SSH and GPG key
> New SSH key
and paste your public key.
- Install and create tasks to the OpenShift cluster
# Clone task from tekton hub
>> oc apply -f https://raw.givthubusercontent.com/tektoncd/catalog/main/task/git-clone/0.5/git-clone.yaml
# Custom task
# ex) only showing README.md of the private repository
>> oc apply -f task.yaml
>> tkn task list
NAME DESCRIPTION AGE
output-readme 11 seconds ago
git-clone These Tasks are Git... 47 seconds ago
- Create a secret for SSH authentication
>> oc create -f secret.yaml
- Create a pipeline
>> oc create -f ./pipeline.yaml
Run the pipeline by executing the following command and check the result.
# Execute
>> oc create -f pipeline-run.yaml
# Check execution
>> tkn pr ls
# View log of the latest pipeline run
>> tkn pr logs -fL