Monday, April 4, 2022

Module 11: How to make code changes using git bash and push into Github to trigger automated builds and Deployment

After configuring a freestyle job or pipeline using Jenkins for building and deployment, you would like to make a code change to make sure Jenkins have started automated builds/deployments.


Pre-requistes:
SSH keys set up and uploaded into Github.

Implementation steps:(if you already cloned using lab #2, you can go directly to step 6)
1. Go to bitbucket, select repository which you already have setup MyWebApp.
2. Click on clone
3. copy SSH clone url


4. go to git bash window, got to download directory. login to EC2 to Jenkins Ubuntu instance.
Please dont paste on your local machine. you should login to EC2 by connecting using the below url:

5. paste the clone url you copied in step # 3 and enter
git clone git@bitbucket.org:username/repo_name.git
6. cd repo_name
7. cd MyWebApp/src/main/webapp
8. sudo vi index.jsp
Screen Shot 2018-11-07 at 3.31.04 PM.png
Change Hello world into below yellow highlighted:
<html>
<body>
<h2>Howdy Folks !!! Welcome to DevOps!</h2>
<h2>It's possbile</h2>

</body>
</html>

9. press escape, enter :wq!
10. git add index.jsp
11. git commit -m "made change to jsp"
12. git push

Now refresh the browser and click on Source to see code changes you made in your git bash window. Now after making this code change, if you have webhooks configured, it should have triggerd build in Jenkins.

No comments:

Post a Comment

Module 34: Understanding Terraform

  Terraform is a platform-agnostic tool that allows you to build, change, and version infrastructure securely and efficiently. Terraform is ...