Expected Outcome:
-
CI/CD concepts
-
Automate container build on code checkin
-
Perform testing - functional, unit, regression
-
Deploy to various environments - dev(local), staging, prod
Lab Requirements:
-
fork of this repository in your own github account (https://github.com/christopherhein/aws-container-migration-workshop)
-
Completion of Kubernetes Manifest Module, with a petstore deployment in your kubernetes cluster.
Average Lab Time: 30 - 45 minutes
Copy your kubeconfig, from your Cloud9 IDE copy the contents of:
cat ~/.kube/config
Create a file on your Jenkins instance with the contents of the above at ~/.kube/config
From the main workshop cloudformation output section, look for your JenkinsIP
, open this up in a browser and login:
username: jenkins
password: jenkins101
Click on the job aws-workshop
and to the left click on the configure
link.
Check the box labeled GitHub Project
and then enter your GitHub URL in the Project url
section.
Scroll down to the parameters
section and enter your ECR respository name as the default value for the ECR_REPO
parameter.
Scroll down to the Build Triggers
section and check the box labeled GitHub hook trigger for GITScm polling
.
Scroll down to the Advanced Project Options
section and change the Repository URL
and point this to https://github.com/christopherhein/aws-container-migration-workshop
.
Then change the Script Path
and set that to cicd-concepts/Jenkinsfile
.
Scroll all the way down and click Apply
and then Save
.
Open a browser window to the GitHub fork and click on the Settings
tab in the upper right hand corner.
Click on the Webhooks
link on the left side of the screen and then click the Add Webhook
button in the upper right hand corner.
In the Payload URL
dialog box enter http://<JenkinsIP>/github-webhook/
, replacing <JenkinsIP>
with the IP address of your Jenkins instance.
Make a change to containerize-application/app/src/main/webapp/shopping/main.xhtml
and then check in and commit your code at the root of your repo:
git add . && git commit -m "testing ci/cd" && git push origin master
Go back to your Jenkins browser and watch as your code change moves through the various stages.
Once the deployment is completed you can go back to your petstore application and see your change reflected.