- Code Ready Containers CRC (Can be replaced by any other RedHat OCP cluster)
- OC CLI - https://docs.openshift.com/container-platform/4.8/cli_reference/openshift_cli/getting-started-cli.html
- Tekton CLI - https://tekton.dev/vault/cli-v0.21.0/
- Helm CLI - https://helm.sh/docs/intro/install/
- Tekton Hub: https://hub.tekton.dev/
- Tekton Docu: https://tekton.dev/docs/pipelines/
In your shell:
crc setup
crc start --memory 16000 --disk-size 50 --cpus 8
In your shell:
oc new-project tekton-demo
https://github.com/tektoncd/catalog/tree/main/task/buildah
In your shell:
tkn hub install task git-clone
tkn hub install task buildah
tkn hub install task kaniko
tkn hub install task openshift-client
If using Helm for deployment:
tkn hub install task helm-upgrade-from-source
Create file repo.yaml with content:
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: git-ocp-test-git
namespace: tekton-demo
spec:
url: 'https://github.com/majoferenc/ocp-test.git'
Bash:
CRC_REGISTRY_SERVER=default-route-openshift-image-registry.apps-crc.testing
CRC_USERNAME=kubeadmin
CRC_PASSWORD=$(oc whoami -t)
[email protected]
CRC_SECRET_NAME=docker-credentials
Powershell:
$CRC_REGISTRY_SERVER = "default-route-openshift-image-registry.apps-crc.testing"
$CRC_USERNAME = "kubeadmin"
$CRC_PASSWORD = (oc whoami -t)
$CRC_EMAIL = "[email protected]"
$CRC_SECRET_NAME = "docker-credentials"
Bash:
oc create secret docker-registry $CRC_SECRET_NAME \
--docker-server=$CRC_REGISTRY_SERVER \
--docker-username=$CRC_USERNAME \
--docker-password=$CRC_PASSWORD \
--docker-email=$CRC_EMAIL
Powershell:
oc create secret docker-registry $CRC_SECRET_NAME `
--docker-server=$CRC_REGISTRY_SERVER `
--docker-username=$CRC_USERNAME `
--docker-password=$CRC_PASSWORD `
--docker-email=$CRC_EMAIL
oc secrets link default -n tekton-demo $CRC_SECRET_NAME --for=pull
oc import-image ubi8/openjdk-8:1.18-2 --from=registry.access.redhat.com/ubi8/openjdk-8:1.18-2 --confirm
oc policy add-role-to-user edit -z default -n tekton-demo
oc apply -f .tekton/pipeline.yaml
oc create -f .tekton/pipelinerun.yaml
oc apply -f .tekton/push.yaml
helm create testapp-chart
helm upgrade --install testapp ./helm/testapp-chart/