{"id":21428045,"url":"https://github.com/redhat-developer-demos/tutorials-pipelines","last_synced_at":"2025-07-14T10:31:37.812Z","repository":{"id":91531572,"uuid":"196815600","full_name":"redhat-developer-demos/tutorials-pipelines","owner":"redhat-developer-demos","description":"Tekton CD Pipeline Demos","archived":false,"fork":false,"pushed_at":"2019-12-25T03:11:03.000Z","size":51,"stargazers_count":14,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T04:05:22.656Z","etag":null,"topics":["demos","kubernetes","minikube","pipelines","tekton","tektoncd"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-developer-demos.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-14T09:07:24.000Z","updated_at":"2022-08-19T15:15:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"df1a9c16-4b59-4a33-85bb-95e5ccf256df","html_url":"https://github.com/redhat-developer-demos/tutorials-pipelines","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-developer-demos/tutorials-pipelines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Ftutorials-pipelines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Ftutorials-pipelines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Ftutorials-pipelines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Ftutorials-pipelines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-developer-demos","download_url":"https://codeload.github.com/redhat-developer-demos/tutorials-pipelines/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Ftutorials-pipelines/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265280637,"owners_count":23739851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demos","kubernetes","minikube","pipelines","tekton","tektoncd"],"created_at":"2024-11-22T22:09:59.103Z","updated_at":"2025-07-14T10:31:37.801Z","avatar_url":"https://github.com/redhat-developer-demos.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Istio and Knative Tutorial Pipelines \n\nThe https://tekton.dev[Tekton Pipelines] that can be used to deploy:\n\n*  https://bit.ly/istio-tutorial[Istio Tutorial] applications to OpenShift/Kubernetes\n*  https://bit.ly/knative-tutorial[Knative Tutorial] applications to OpenShift/Kubernetes**(WIP)**\n\n== Pre-req\n\nAn OpenShift4 cluster with following components:\n\n- Istio - To play with servicemesh functionalities\n- Knative Serving - To play with severless functionalities \n- https://github.com/openshift/pipelines-tutorial#install-openshift-pipelines[Install Tekton Pipelines]\n- https://github.com/tektoncd/cli/releases/latest[Tekton CLI]\n\n\n== Create Tutorial Project in OpenShift\n\n[source,bash]\n----\noc new-project tutorial \u0026\u0026 \\\n! oc create serviceaccount pipeline \u0026\u0026 \\\noc adm policy add-scc-to-user privileged -z pipeline \u0026\u0026 \\\noc adm policy add-role-to-user edit -z pipeline \u0026\u0026 \\\noc adm policy add-scc-to-user privileged -z default \u0026\u0026 \\\noc adm policy add-scc-to-user anyuid -z default \u0026\u0026 \\\noc create -f https://raw.githubusercontent.com/redhat-developer-demos/tutorials-pipelines/pipelines-common/pipeline-role-sa.yaml\n -n tutorial \u0026\u0026 \\\noc policy add-role-to-user pipeline-roles -z pipeline --role-namespace=tutorial\n----\n\n== Deploy Nexus(Optional)\n\nTo make maven builds faster, we will deploy Sonatype Nexus\n\n[source,bash]\n----\noc new-app sonatype/nexus\n----\n\n== Tasks\n\nCreate the following Tekton tasks which will be used in the `Pipelines`\n\n[source,bash]\n----\noc create -n tutorial \\\n  -f https://raw.githubusercontent.com/tektoncd/catalog/master/kn/kn.yaml\n\noc create -n tutorial \\\n-f https://raw.githubusercontent.com/tektoncd/catalog/master/openshift-client/openshift-client-task.yaml\n\noc create -n tutorial \\\n  -f https://raw.githubusercontent.com/redhat-developer-demos/knative-tutorial/master/06-pipelines/build-app-task.yaml\n\n----\n\nCheck the tasks created\n\n[source,bash]\n----\ntkn task ls\n----\n\n```\nNAME                AGE\nNAME               AGE\nbuild-app          3 seconds ago\nkn                 5 seconds ago\nopenshift-client   4 seconds ago\n```\n\n== Application Deployment\n\n== Download the sources\n\n[source,bash]\n----\ngit clone https://github.com/redhat-developer-demos/tutorials-pipelines\ncd tutorials-pipelines\n----\n\n== Common\n\n[source,bash]\n----\noc create -f pipelines-common/resources.yaml \\\n  -f pipelines-common/pipeline-deploy.yaml \\ #\u003c1\u003e\n  -f pipelines-common/pipeline-kn-deploy.yaml #\u003c2\u003e\n----\n\n\u003c1\u003e Pipeline used for vanilla Kubernetes/OpenShift deployment\n\u003c2\u003e Pipeline used for serverless (knative) deployment\n\n== Customer\n\n[source,bash]\n----\n# create customer deployment config \noc create -f customer/app.yaml\n\n# start the customer deploy pipeline \ntkn pipeline start rhd-tutorial-deploy \\\n --param=\"applicationSrcDir=customer\" \\\n --param=\"deploymentConfig=customer\" \\\n --param=\"mavenMirrorUrl=http://nexus:8081/nexus/content/groups/public\" \\\n --resource=\"app-git=git-source\" \\\n --resource=\"app-image=customer-openshift-image\" \\\n --serviceaccount='pipeline' \n----\n\nWatch the logs of pipeline run using the command \n[source,bash]\n----\n# get the running pipeline id \ntkn pipelinerun ls\n# get logs of the pipeline via\ntkn pipelinerun logs -a -f \u003cid-from-previous-command\u003e\n----\n\n== Preference\n\n[source,bash]\n----\n# create preference deployment config \noc create -f preference/app.yaml\n\n# start preference deployment pipeline\ntkn pipeline start rhd-tutorial-deploy \\\n --param=\"applicationSrcDir=preference\" \\\n --param=\"deploymentConfig=preference\" \\\n --param=\"mavenMirrorUrl=http://nexus:8081/nexus/content/groups/public\" \\\n --resource=\"app-git=git-source\" \\\n --resource=\"app-image=preference-openshift-image\" \\\n --serviceaccount='pipeline' \n----\n\nWatch the logs of pipeline run using the command \n\n[source,bash]\n----\n# get the running pipeline id \ntkn pipelinerun ls\n# get logs of the pipeline via\ntkn pipelinerun logs -a -f \u003cid-from-previous-command\u003e\n----\n\n\n== Recommendation\n\n=== Version 1\n\n==== Vanilla OpenShift/Kubernetes Deployment\n\n[source,bash]\n----\noc create -f recommendation/app-v1.yaml\n\ntkn pipeline start rhd-tutorial-deploy \\\n --param=\"applicationSrcDir=recommendation\" \\\n --param=\"deploymentConfig=recommendation\" \\\n --param=\"mavenMirrorUrl=http://nexus:8081/nexus/content/groups/public\" \\\n --resource=\"app-git=git-source\" \\\n --resource=\"app-image=recommendation-openshift-image-v1\" \\\n --serviceaccount='pipeline' \n----\n\n==== Knative Service Deployment\n\n[source,bash]\n----\ntkn pipeline start rhd-tutorial-kn-deploy \\\n --param=\"applicationSrcDir=recommendation\" \\\n --param=\"mavenMirrorUrl=http://nexus:8081/nexus/content/groups/public\" \\\n --resource=\"app-git=git-source\" \\\n --resource=\"app-image=recommendation-openshift-image-v1\" \\\n --serviceaccount='pipeline' \n----\n\nWatch the logs of pipeline run using the command \n\n[source,bash]\n----\n# get the running pipeline id \ntkn pipelinerun ls\n# get logs of the pipeline via\ntkn pipelinerun logs -a -f \u003cid-from-previous-command\u003e\n----\n\n=== Version 2\n\n==== Vanilla OpenShift/Kubernetes Deployment\n\n[source,bash]\n----\noc create -f recommendation/app-v2.yaml \n\ntkn pipeline start rhd-tutorial-deploy \\\n --param=\"applicationSrcDir=recommendation\" \\\n --param=\"deploymentConfig=recommendation\" \\\n --param=\"mavenMirrorUrl=http://nexus:8081/nexus/content/groups/public\" \\\n --resource=\"app-git=git-source-v2\" \\\n --resource=\"app-image=recommendation-openshift-image-v2\" \\\n --serviceaccount='pipeline' \n----\n\n==== Knative Service Deployment\n\n[source,bash]\n----\ntkn pipeline start rhd-tutorial-kn-deploy \\\n --param=\"applicationSrcDir=recommendation\" \\\n --param=\"mavenMirrorUrl=http://nexus.rhd-workshop-infra:8081/nexus/content/groups/public\" \\\n --resource=\"app-git=git-source-v2\" \\\n --resource=\"app-image=recommendation-openshift-image-v2\" \\\n --serviceaccount='pipeline' \n----\n\nWatch the logs of pipeline run using the command \n\n[source,bash]\n----\n# get the running pipeline id \ntkn pipelinerun ls\n# get logs of the pipeline via\ntkn pipelinerun logs -a -f \u003cid-from-previous-command\u003e\n----\n\n=== Knative \n\n[source,bash]\n----\noc create -f greeter/pipeline-deploy.yaml \\\n  -f greeter/pipeline-run.yaml\n----\n\nWatch the logs of pipeline run using the command \n\n[source,bash]\n----\n# get the running pipeline id \ntkn pipelinerun ls\n# get logs of the pipeline via\ntkn pipelinerun logs -a -f \u003cid-from-previous-command\u003e\n----\n\n== Cleanup\n\n* Delete all pipeline runs \n[source,bash]\n----\ntkn pipelinerun ls | awk 'NR\u003e1{print $1}' | xargs oc delete pipelinerun \n----\n\n* Delete all pipelines\n[source,bash]\n----\noc delete -f pipelines-commons/pipeline-deploy.yaml\n----\n\n* Delete applications\n[source,bash]\n----\noc delete -f recommendation/app-v1.yaml \\\n  -f recommendation/app-v2.yaml \\\n  -f preference/app.yaml \\\n  -f customer/app.yaml \n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer-demos%2Ftutorials-pipelines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-developer-demos%2Ftutorials-pipelines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer-demos%2Ftutorials-pipelines/lists"}