This bundle contains two CI engines. Two microservices (ms-frontend and ms-backend) are imported and have their own pipeline defined. The ms-frontend microservice has a pipeline defined to execute with the help of Jenkins as the build engine. The ms-backend microservice has a pipeline definition which Argo executes. This tutorial includes walk-through guides for both:
Included microservice "ms-frontend" in the Gerrit Git repo will be handled Jenkins pre & post-merge pipelines
The source code repo includes the Jenkinsfile describing the pipelines which will use the shared Jenkins pipeline code in Gerrit/Git
- Login to Jenkins (admin/admin)
- Click Credentials
- For credentials id = IMAGE_REGISTRY_CREDENTIALS, click Name column
- Click Update
- Enter Username/Password for your image registry (i.e same as defined in file config-user.bash)
Pipeline Execution: pre-merge Jenkins pipeline
Clone gerrit repo: ms-frontend:
- Logon to Gerrit server: cx-gerrit-<namespace>.<domainname>
- Click Sign In
- User/Psw: easy2use/password123
- Choose Projects/List
- Click ms-frontend
- Click General tab
- Click http & copy clone address
- git clone http://easy2use@cx-gerrit-<namespace>.<yourdomainname>/a/ms-frontend.git
- Open terminal (ex git bash or similar)
- Parse git clone cmd
- cd ms-frontend
- Do some changes do your local ms-frontend git repo
- commit and push changes
- git add .
- git commit -m "msfrontendchanges"
- git push origin HEAD:refs/for/master
If user/psw dialog pops up, then enter:
- User: easy2use
- Psw: gX6aUy55fjSgJfldDItW2WiCpoiid+2tK9FyqayQlg
Check your pushed patchset
- Open Gerrit cx-gerrit-<namespace>.<domainname>
- Click Sign In
- User/Psw: easy2use/password123
- Chose My/Changes
- Click "msfrontendchanges"
2.2. Check started Jenkins ms-frontend job, pre-merge triggered via git push to Gerri (Gerrit Trigger)
- Logon to Jenkins: cx-jenkins-<namespace>.<domainname>
- User/Psw: admin/admin
- Click "Blueocean"
- Click ms-frontend to see pre-merge pipeline execution
- After successful execution, the pipeline will update Gerrit "Verified" to +1 (else -1 if error in pipeline)
- Logon to Gerrit server: cx-gerrit-<namespace>.<domainname>
- Click Sign In
- User/Psw: easy2use/password123
- Chose My/Changes
- Click "msfrontendchanges"
- Check that "Verified" is set to +1
- Set Review to +2
- Click submit button
- Logon to Jenkins: cx-jenkins-<namespace>.<domainname>
- User/Psw: admin/admin
- Click "Blueocean"
- Click ms-frontend to see post-merge pipeline execution
- Instruction TBD XXXXX
- Goto: cx-argocd-<namespace>.<domainname>
- Username: admin
- Password: get psw with -> ./easy2use list Cx -n <namespace>
Deployed microservices will be visible in printout from cmd:
./easy2use list Cx -n <namespace>
- dev
- ms-frontend-dev-<namespace>.<domainname>/api/greeting
- ms-backend-dev-<namespace>.<domainname>/api/hellobackend
- stage
- ms-frontend-stage-<namespace>.<domainname>/api/greeting
- ms-backend-stage-<namespace>.<domainname>/api/hellobackend Info: 2 replicas created
- prod (master)
- ms-frontend-prod-<namespace>.<domainname>/api/greeting
- ms-backend-prod-<namespace>.<domainname>/api/hellobackend Info: 3 replicas created
After the initial patchset merge (submit) in Gerrit all Branches dev/stage/prod (master) will have the same versions which Argo-CD synced to K8S.
Now promotion can be performed by merging dev -> stage -> master (prod)
Perform another update in ms-frontend and push patchset it for review, follow steps 2.1-2.3 again.
Now the new patchset is merged (submitted) to dev branch, and synced via Argo-CD in K8S.
Deploy to stage, merge dev to stage.
git pull origin dev
git checkout stage
git pull origin stage
git merge dev
git push origin stage
Now Argo-CD will sync the new changes in the stage branch. Also check steps 4-5.
Deploy to Prod, merge stage to master prod.
git pull origin stage
git checkout master
git pull origin master
git merge stage
git push origin master
Now Argo-CD will sync the new changes in the master (prod) branch. Also check steps 4-5.
Included microservice "ms-backend" in the Gerrit Git repo will be handled in Argo pre & post-merge pipelines
Clone Gerrit repo: ms-backend:
- Logon to Gerrit server: cx-argo-<namespace>.<domainname>
- Click Sign In
- User/Psw: easy2use/password123
- Choose Projects/List
- Click ms-backend
- Click General tab
- Click http & copy clone address
- git clone http://easy2use@cx-gerrit-\<namespace>.<yourdomainname>/a/ms-backend.git
- Open terminal (ex git bash or similar)
- Parse git clone cmd
- cd ms-frontend
- Do some changes do your local ms-backend git repo
- commit and push changes
- git add .
- git commit -m "msbackendchanges"
- git push origin HEAD:refs/for/master
If user/psw dialog pops up, then enter:
- User: easy2use
- Psw: gX6aUy55fjSgJfldDItW2WiCpoiid+2tK9FyqayQlg
Check your pushed patchset
- Open Gerrit cx-gerrit-<namespace>.<domainname>
- Click Sign In
- User/Psw: easy2use/password123
- Chose My/Changes
- Click "msbackendchanges"
- cx-argo-.
- Click on workflows icon on the left manu
- After successful execution, the pipeline will update Gerrit "Verified" to +1 (else -1 if error in pipeline)
- Logon to Gerrit server: cx-gerrit-<namespace>.<domainname>
- Click Sign In
- User/Psw: easy2use/password123
- Chose My/Changes
- Click "msbackendchanges"
- Check that "Verified" is set to +1
- Set Review to +2
- Click submit button
- cx-argo-<namespace>.<domainname>
- Click on workflows icon on the left manu
- Instruction TBD XXXXX
- Goto: cx-argocd-<namespace>.<domainname>
- Username: admin
- Password: get psw with -> ./easy2use list Cx -n <namespace>
Deployed microservices will be visible in printout from cmd:
./easy2use list Cx -n <namespace>
- dev
- ms-frontend-dev-<namespace>.<domainname>/api/greeting
- ms-backend-dev-<namespace>.<domainname>/api/hellobackend
- stage
- ms-frontend-stage-<namespace>.<domainname>/api/greeting
- ms-backend-stage-<namespace>.<domainname>/api/hellobackend Info: 2 replicas created
- prod (master)
- ms-frontend-prod-<namespace>.<domainname>/api/greeting
- ms-backend-prod-<namespace>.<domainname>/api/hellobackend Info: 3 replicas created
After the initial patchset merge (submit) in Gerrit all Branches dev/stage/prod (master) will have the same versions which Argo-CD synced to K8S.
Now promotion can be performed by merging dev -> stage -> master (prod)
Perform another update in ms-frontend and push patchset it for review, follow steps 1.1-1.3 again.
Now the new patchset is merged (submitted) to dev branch, and synced via Argo-CD in K8S.
Deploy to stage, merge dev to stage.
git pull origin dev
git checkout stage
git pull origin stage
git merge dev
git push origin stage
Now Argo-CD will sync the new changes in the stage branch. Also check steps 3-4.
Deploy to Prod, merge stage to master prod.
git pull origin stage
git checkout master
git pull origin master
git merge stage
git push origin master
Now Argo-CD will sync the new changes in the master (prod) branch. Also check steps 3-4.