https://github.com/leandroberetta/openshift-cicd-demo
OpenShift CI/CD Demo
https://github.com/leandroberetta/openshift-cicd-demo
cicd kubernetes openshift pipelines tekton
Last synced: about 2 months ago
JSON representation
OpenShift CI/CD Demo
- Host: GitHub
- URL: https://github.com/leandroberetta/openshift-cicd-demo
- Owner: leandroberetta
- Created: 2017-08-31T01:34:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-21T00:39:38.000Z (about 5 years ago)
- Last Synced: 2025-04-02T05:42:22.504Z (3 months ago)
- Topics: cicd, kubernetes, openshift, pipelines, tekton
- Language: Java
- Homepage:
- Size: 1.13 MB
- Stars: 9
- Watchers: 2
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenShift CI/CD Demo
Basic demonstration of OpenShift Pipelines for deploying applications across environments.
## Pipelines

## Demo
### Prerequisites
* OpenShift 4.1 or higher
* OpenShift Pipelines installed in OpenShift### Projects
Create the projects (environments):
oc apply -R -f ./environments
### Pipelines
Create the tasks:
oc apply -R -f ./tasks
Create the pipelines:
oc apply -R -f ./pipelines
Create the triggers (webhooks):
oc apply -R -f ./triggers
Get the route for the webhook:
export HELLO_EVENT_LISTENER_ROUTE=$(oc get route el-hello-event-listener -o jsonpath='{.spec.host}' -n hello-dev)
#### CI Pipeline (deploy to DEV building from develop branch)
A CI pipeline is started with a push event from the repository (Webhook). It can be simulated with the following command:
curl -v http://$HELLO_EVENT_LISTENER_ROUTE \
-H 'X-GitHub-Event: push' \
-H 'X-Hub-Signature: sha1=9f257f3c340bf1c2d116f5cd99aeacf62811b657' \
-H 'Content-Type: application/json' \
-d '{"ref": "refs/heads/develop","head_commit": {"id": "master"},"repository": {"url": "https://github.com/leandroberetta/openshift-cicd-demo"}}'Note: the **head_commit.id** field is set to *master* just for demo reasons, in real scenarios the request will be generated by the repository with the correct values.
This action creates a PipelineRun:

#### CD Pipeline (deploy to TEST and PROD building from master branch)
A CD pipeline is started with a pull request event from the repository. It can be simulated with the following command:
curl -v http://$HELLO_EVENT_LISTENER_ROUTE \
-H 'X-GitHub-Event: push' \
-H 'X-Hub-Signature: sha1=eaf4126c4193f189bde68af2700b12d629c22674' \
-H 'Content-Type: application/json' \
-d '{"ref": "refs/heads/master","head_commit": {"id": "master"},"repository": {"url": "https://github.com/leandroberetta/openshift-cicd-demo"}}'This action creates a PipelineRun:
