You may fork this repo and make edit to the
application-deployment/store/quarkuscoffeeshop-majestic-monolith/transformer-patches.yaml
in for GitOps or argocd
Create Projects and configure permissions
oc new-project quarkuscoffeeshop-cicd
oc new-project quarkuscoffeeshop-integration
oc adm policy add-role-to-user admin system:serviceaccount:quarkuscoffeeshop-integration:pipeline -n quarkuscoffeeshop-cicd
oc policy add-role-to-group system:image-puller system:serviceaccounts:quarkuscoffeeshop-integration -n quarkuscoffeeshop-cicd
oc adm policy add-role-to-user admin system:serviceaccount:quarkuscoffeeshop-cicd:pipeline -n quarkuscoffeeshop-integration
Run the kustomize command to deploy pipelines
kustomize build quarkuscoffeeshop-majestic-monolith | oc create -f -
Update Environment Variables in deployment
oc edit deployment.apps/quarkuscoffeeshop-majestic-monolith -n quarkuscoffeeshop-integration
Run the command below to enable to Anisble Tower Pipeline
oc create -f quarkuscoffeeshop-majestic-monolith/pipeline/deploy-to-edge-pipeline.yaml
See triggerbinding-configs before going to next step
Create Webhook for quarkuscoffeeshop-majestic-monolith
oc -n quarkuscoffeeshop-cicd create -f ./quarkuscoffeeshop-majestic-monolith/webhook.yaml
Create quarkuscoffeeshop-majestic-monolith Webhook
oc -n quarkuscoffeeshop-cicd create route edge monolith-webhook --service=el-quarkuscoffeeshop-majestic-monolith-webhook --port=8080 --insecure-policy=Redirect
NOTE: Every Git server has its own properties, but basically you want to provide the ingress url for our webhook and when the Git server should send the hook. E.g: push events, PR events, etc.
- Go to your application repository on GitHub, eg: https://github.com/jeremyrdavis/quarkuscoffeeshop-majestic-monolith
- Click on
Settings
->Webhooks
- Create the following
Hook
Payload URL
: Output of commandoc -n quarkuscoffeeshop-cicd get route monolith-webhook -o jsonpath='https://{.spec.host}'
Content type
: application/jsonSecret
: v3r1s3cur3cat saved-secert.txt
Events
: Check Push Events, leave others blankActive
: Check itSSL verification
: Check Disable- Click on
Add webhook
configure pvc
oc -n quarkuscoffeeshop-cicd create -f quarkuscoffeeshop-majestic-monolith/pvc/pvc.yml
oc -n quarkuscoffeeshop-cicd create -f ./quarkuscoffeeshop-majestic-monolith/pvc/maven-source-pvc.yml
configure Tasks
oc -n quarkuscoffeeshop-cicd create -f ./common-functions/tasks/git-clone.yaml
oc -n quarkuscoffeeshop-cicd create -f ./common-functions/tasks/openshift-client-task.yaml
oc -n quarkuscoffeeshop-cicd create -f ./common-functions/tasks/maven.yaml
Configure push image to quay task
oc -n quarkuscoffeeshop-cicd create -f ./quarkuscoffeeshop-majestic-monolith/tektontasks/pushImageToQuay.yaml
configure Resources
oc -n quarkuscoffeeshop-cicd create -f ./quarkuscoffeeshop-majestic-monolith/resources/git-pipeline-resource.yaml
oc -n quarkuscoffeeshop-cicd create -f ./quarkuscoffeeshop-majestic-monolith/resources/image-pipeline-resource.yaml
Create Pipeline
oc -n quarkuscoffeeshop-cicd create -f ./quarkuscoffeeshop-majestic-monolith/pipeline/deploy-pipeline.yaml
- Configure permissions for project
oc new-project quarkuscoffeeshop-integration
oc adm policy add-role-to-user admin system:serviceaccount:quarkuscoffeeshop-integration:pipeline -n quarkuscoffeeshop-cicd
oc policy add-role-to-group system:image-puller system:serviceaccounts:quarkuscoffeeshop-integration -n quarkuscoffeeshop-cicd
oc adm policy add-role-to-user admin system:serviceaccount:quarkuscoffeeshop-cicd:pipeline -n quarkuscoffeeshop-integration
- Run build pipeline
- Run the below commands
oc project quarkuscoffeeshop-integration
oc create -f application-deployment/store/quarkuscoffeeshop-majestic-monolith -n quarkuscoffeeshop-integration
Update Environment Variables in deployment
oc edit deployment.apps/quarkuscoffeeshop-majestic-monolith