Let us see how to push a code change using Git bash or iTerm from Jenkins EC2 instance into GitHub.
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-requisites:
- SSH keys set up and uploaded into GitHub.
- Connect to Jenkins EC2 instance using GitHub.
- Project setup already in GitHub
Implementation steps:
1. Login to Jenkins EC2 instance first. Make sure you are inside EC2 instance.
2. Type below command to see if you have already cloned your repository.
(If you don't see any GitHub Repo folder already cloned, you need to clone from GitHub by executing below command:
git clone git@github.com:user_name/your_repo.git
now go inside repo folder.
3. cd youreponame
change repo_name per your name of the repo you created in GitHub.
change repo_name per your name of the repo you created in GitHub.
Go into below folder by typing the command:
4. Now try to get latest code changes from GitHub into local repo by performing below command:
git pull
5. cd MyWebApp/src/main/webapp
Now you can edit below file to reflect changes in Tomcat
Change Hello world into below yellow highlighted:
<html>
<body>
<h2>Howdy Folks !!! Welcome to DevOps!</h2>
</body>
</html>
7. press escape, enter :wq!
8. git add index.jsp
9. git commit -m "made change to jsp"
10. git push
Now Login to GitHub and verify the code changes you made are pushed into your repo in GitHub.
I am really happy to say it’s an interesting post to read. I learn new information from your article, you are doing a great job, Keep it up.
ReplyDeletemobile phone repair in Novi
iphone repair in Novi
cell phone repair in Novi
phone repair in Novi
tablet repair in Novi
ipad repair in Novi
mobile phone repair Novi
iphone repair Novi
cell phone repair Novi
phone repair Novi