quarkuscoffeeshop Tekton pipelines Guide

Once Postgres Operator Database is installed run the following below

$ cat >source.env<<EOF
CLUSERTER_DOMAIN_NAME=clustername.example.com
TOKEN=sha256~XXXXXXXXXXXX
ACM_WORKLOADS=y
AMQ_STREAMS=y
CONFIGURE_POSTGRES=y
MONGODB_OPERATOR=n
MONGODB=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

Store front microservices

This will build the development environment for the quarkuscoffeeshop store.

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

quarkuscoffeeshop-barista tekton pipeline

    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/quarkuscoffeeshop-barista

quarkuscoffeeshop-counter tekton pipeline

    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/quarkuscoffeeshop-counter

quarkuscoffeeshop-kitchen tekton pipeline

    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/quarkuscoffeeshop-kitchen

quarkuscoffeeshop-web tekton pipeline

    # Change to internal quay repo
    - default: quay.io/quarkuscoffeeshop/quarkuscoffeeshop-web

update the transformer-patches.yaml for each microservice

  • quarkuscoffeeshop-counter 20210918121934
  • quarkuscoffeeshop-web

    CHANGEME=quarkuscoffeeshop-web-quarkuscoffeeshop-demo.apps.ocp4.example.com 20210918122147

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-barista argo application

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

quarkuscoffeeshop-counter argo application

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

quarkuscoffeeshop-kitchen argo application

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

quarkuscoffeeshop-web argo application

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

20210918122954

To run pipelines go to the quarkuscoffeeshop-cicd project

20210918123135

To start the build-and-push-quarkuscoffeeshop-barista pipeline 20210918123445 20210918123532

To start the build-and-push-quarkuscoffeeshop-counter pipeline 20210918123622 20210918123709

To start the build-and-push-quarkuscoffeeshop-kitchen pipeline 20210918131559 20210918131650

To start the build-and-push-quarkuscoffeeshop-web pipeline 20210918131734 20210918131809

Deployment Validation

WIP