This repository is made with the purpose to training CICD and GitOps aproach with Tekton and ArgoCD under OpenShift 4 cluster, but you can use it with Kubernetes vanilla too.
There are two associated repositories, production-api repository for application source code, and production-api-k8s which contains descriptors for prodution-api Kubernetes components.
- OpenShift 4 cluster *
- Openshift cli *
- kubeseal cli
- quay.io account
* You can use Kubernetes without problems, but you need change 'oc' command for 'kubectl' into setup script and change event listener route for ingress controller.
- Fork production-api and production-api-k8s
- In product-api repository, build image and push to your quay repository (you must be logged in quay.io):
podman login quay.io
podman build . -f src/main/docker/Dockerfile.jvm -t quay.io/<your_user>/product-api:1.0
podman push quay.io/<your_user>/product-api:1.0
- Change production-api repository url for your forked repository in gitops/application/application-pro-shop-main.yaml (line 13)
- In cicd/trigger/trigger-template.yaml, change production-api repository url (line 24) and production-api-k8s url (line 36) for your forked repositories
- In the same file, image-url param (line 30) for your product-api image url in your quay.io account
- Execute setup script (you must be logged on Openshift with a user who has cluster admin permissions)
- Get Github event listener url. Execute the command and copy the output
oc get route el-github-listener -o template --template='{{"http://"}}{{.spec.host}}'
- Create a webhook in your product-api repository: https://github.com/<your_user>/product-api/settings/hooks/new (Use the previous url to setting 'Payload URL in webhook)
- Enjoy!