quarkuscoffeeshop homeoffice Tekton pipelines Guide

Requirements

Run the following command beloww

https://github.com/quarkuscoffeeshop/quarkuscoffeeshop-ansible/blob/master/README.md

$ cat >source.env<<EOF
CLUSERTER_DOMAIN_NAME=clustername.example.com
TOKEN=sha256~XXXXXXXXXXXX
ACM_WORKLOADS=y
AMQ_STREAMS=y
CONFIGURE_POSTGRES=n
HELM_DEPLOYMENT=n
DELETE_DEPLOYMENT=false
EOF
$ podman run  -it --env-file=./source.env  quay.io/quarkuscoffeeshop/quarkuscoffeeshop-ansible:v4.10.24

Install tkn cli
on linux

# Get the tar.xz
curl -LO https://github.com/tektoncd/cli/releases/download/v0.20.0/tkn_0.20.0_Linux_x86_64.tar.gz
# Extract tkn to your PATH (e.g. /usr/local/bin)
sudo tar xvzf tkn_0.20.0_Linux_x86_64.tar.gz -C /usr/local/bin/ tkn

on mac

brew install tektoncd-cli

HOME Office (Backoffice)

The gogs route is found under the quarkuscoffeeshop-cicd project

20210916160010 20210916160053

Use the the following to login

  • username: user1
  • password: openshift 20210916160128 20210916160151

20210916160211

The quay registry is found under the quay-enterprise project

20210916160943 20210916161424

Create an admin user for the deployment

  • username: admin
  • email address: admin@example.com
  • password: admin123 20210916161516 20210916161551

Create Quarkuscoffeeshop organization for images

  • Organization Name: quarkuscoffeeshop 20210916161629 20210916161651

update the deploy-pipeline.yaml for the following services in gogs

  • homeoffice-ingress
    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/homeoffice-ingress
  • homeoffice-backend
    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/homeoffice-backend
  • quarkuscoffeeshop-homeoffice-ui
    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/quarkuscoffeeshop-homeoffice-ui
    # change to your url 
    - default: >-
    http://quarkuscoffeeshop-homeoffice-ui-quarkuscoffeeshop-homeoffice.apps.shop.example.com/graphql

update the transformer-patches.yaml for each microservice

  • homeoffice-ingress

    this is for the postgres password you can find this at the bottom off the doc 20210916162845

  • homeoffice-backend

    this is for the postgres password you can find this at the bottom off the doc 20210916162812

update the quarkuscoffeeshop-homeoffice-ui-route.yaml for quarkuscoffeeshop-homeoffice-ui

20210916163055

To access Argocd

20210916163958

20210916164028

The password for argocd is found under the following secret 20210916164140

Login to argocd

20210916164230 20210916164312

Terminal clone your git repo

git clone http://gogs-quarkuscoffeeshop-cicd.apps.ocp4.example.com/user1/tekton-pipelines.git

login to OpenShift cluster

oc login --token=sha256~yoursha --server=https://api.ocp4.example.com:6443

cd into tekton pipelines folder

cd tekton-pipelines

update repo url

REPO_URL='http://gogs-quarkuscoffeeshop-cicd.apps.ocp4.example.com/user1/tekton-pipelines.git'

load the argocd application templates for each microservice

quarkuscoffeeshop-homeoffice-ui argo application

sed "s|%REPO_NAME%|'${REPO_URL}'|g" argocd/quarkuscoffeeshop-homeoffice-ui/quarkuscoffeeshop-homeoffice-ui-template.yaml  > argocd/quarkuscoffeeshop-homeoffice-ui/quarkuscoffeeshop-homeoffice-ui.yaml
oc create -f argocd/quarkuscoffeeshop-homeoffice-ui/quarkuscoffeeshop-homeoffice-ui.yaml  -n openshift-gitops

homeoffice-backend argo application

sed "s|%REPO_NAME%|'${REPO_URL}'|g" argocd/homeoffice-backend/homeoffice-backend-template.yaml  > argocd/homeoffice-backend/homeoffice-backend.yaml
oc create -f argocd/homeoffice-backend/homeoffice-backend.yaml  -n openshift-gitops

homeoffice-ingress argo application

sed "s|%REPO_NAME%|'${REPO_URL}'|g" argocd/homeoffice-ingress/homeoffice-ingress-template.yaml  > argocd/homeoffice-ingress/homeoffice-ingress.yaml
oc create -f argocd/homeoffice-ingress/homeoffice-ingress.yaml  -n openshift-gitops

20210916164929

To run pipelines go to the quarkuscoffeeshop-cicd project

20210916165144

To start the build-and-push-homeoffice-backend pipeline 20210916165411 20210916165442

To start the build-and-push-homeoffice-ingress pipeline 20210916165559 20210916165630

To start the build-and-push-quarkuscoffeeshop-homeoffice-ui pipeline 20210916165749 20210916165816

Deployment Validation

Validate pipeline completes

20210917144852

verify images have been pushed to quay

20210917144806

Verify deployment is successful

20210917144949

Access to homeoffice ui

20210917145049 20210917145109

Postgres password location

20210916163339