Introduction to Continuous integration:
Jenkins is a Continuous Integration (CI) server or tool which is written in java platform. Continuous Integration is a practice of running our tests on a non-developer machine automatically every time we push new code into the source git repository. JENKINS is an open-source free download and install tool.
You can visit here to learn CI/CD with Devops tools in detail.
Let’s take a deep dive and learn more about the fundamentals of Continuous Integration.
Build: Build jobs are at the heart of the Jenkins build process. Simply put, you can think of a Jenkins build job as a particular task or step in your build process. This may involve simply compiling your source code and running your unit tests.
- Test: Testing in DevOps is automated within the build pipeline to ensure that the applications are deployable.
- “continuous integration” and application delivery.
- Git: Git is a Distributed Version Control tool that is used to store different versions of a file in a remote or local repository. It is used to track changes in the source code.
- Continuous integration
- Open-source software
- Installation is easier in all operating systems
- Ant, maven, docker, and many others can be used in it
- Builds can be made based on user requirements
- Git, maven, bitbucket can be easily linkup with it
- It has more than 1000+ plugins to make work easier
- Easy to integrate with Aws Ec2 with plugin.
Install Jenkins on AWS EC2 Cloud
Jenkins is a self-contained Java-based program, ready to run out-of-the-box, with packages for Windows, Mac OS X and other Unix-like operating systems. As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project.
Prerequisites to Install Jenkins:
- EC2 RHEL
7.x Instance
- With Internet Access
- Security Group with Port 8080 open for Internet
- If we are using AWS Ec2 for Jenkins, setup port 8080 should be open in security groups in INBOUND Rules.
- Java v1.8.x
- Should have at least basic knowledge on Linux commands, Git commands.
- Go to Ec2 Dashboard and click on Network security and choose currently Running Ec2 security group.
You can visit here to understand more information about CI/CD pipeline with AWS Cloud
Steps to Launch Ec2 instance:
- Login to AWS console. Select Ec2 launch Instance.
- Select Type of Operating system Amazon Ec2 instance. Choose “Amazon Linux AMI”.
- Select Amazon Ec2 instance as per your project needs.
- Check details VPC, Ec2 Region and leave another options default. Click Next.
- Select storage options by default. It will give 8GB and we can increase volume space.
- Review detail and create Keypair or we can select Existing key pair for Ec2. click on Launch instance.
Steps to login Ec2 instance:
- Download putty and puttygen from “ https://www.putty.org” and install.
- Open puttygen and convert .pem file to .ppk file and save as a private key file.
- Launch putty and use below usernames to login as per our Ec2 instance Types.
For an Amazon Linux AMI, the user name is ec2-user.
•For a RHEL AMI, the user name is ec2-user or root.
•For an Ubuntu AMI, the user name is ubuntu or root.
•For a Centos AMI, the user name is centos.
•For a Fedora AMI, the user name is ec2-user.
•For SUSE, the user name is ec2-user or root.
- Open putty and set Ec2 instance Public Ip and check port number 22.
- Next, click on the + button next to the SSH field to expand this section. Then click on Auth (which stands for authenticate) and enter the name of your private key file (i.e. the ppk file) where it says Private key file for authentication (if you click on browse you can easily search for the directory where you have stored it).
How to install Java
We will be using open Java. To get the latest version, visit http://openjdk.java.net/install/
We can search and install java in Ec2 server by using below command:
# yum search java
# yum install java-1.8*
# yum -y install java-1.8.0-openjdk
Let’s confirm Java Version and set the java home
# java -version
The output should be something like this:
java version “1.8.0_181”
OpenJDK Runtime Environment (amzn-2.6.14.8.80. amzn1-x86_64 u181-b00)
OpenJDK 64-Bit Server VM (build 24.181-b00, mixed mode)
find /usr/lib/jvm/java-1.8* | head -n 3
#JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
export JAVA_HOME
PATH=$PATH: $JAVA_HOME
# To set it permanently update your .bash profile
source ~/.bash profile
STEPS TO INSTALL JENKINS AND CONFIGURE
You can install Jenkins using the rpm or by setting up the repo. We will set up the repo so that we can update it easily in the future. Get the latest version of Jenkins from https://pkg.jenkins.io/redhat-stable/
yum -y install wget
wget -O /etc/yum.repos.d/Jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm –import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum -y install Jenkins
Start Jenkins
Ubuntu:
# sudo systemctl start Jenkins
Linux:
# sudo service Jenkins start
# To check whether it started successfully, run:
systemctl status Jenkins or service Jenkins status
You should see something similar to this:
Accessing Jenkins
By default, Jenkins runs at port 8080. You can access Jenkins at
- Password Location:/var/lib/Jenkins/secrets/initial admin password
- Wait for plugins installation to complete.
- Create username and password and click “save and continue”.
- On the next page, you will be asked to set the URL for the Jenkins instance. The URL field will be populated with an automatically generated URL.
- Complete the setup confirm the URL by clicking on the Save and Finish button.
Let’s create Jenkins Job step by step:
To create a Jenkins project, we need to access Jenkins Dashboard with our Server IP address and port 8080 “http://localhost:8080”. Enter user credentials to login.
STEP1:
STEP2:
After login into Jenkins Dashboard, click on “CREATE NEW ITEM” on the right side.
STEP 3:
Now, we need enter our project name as “Jenkins”.
Choose “Free style project”
Click on “OK”.
STEP 4:
Add description of the Project.
STEP 5:
Now, we need configure Git repository. Visit https://github.com/jenkins/firstproject.git. You will find it under “source code management”.
For this Jenkins and git integration, we need to install git plugin in Jenkins.
Go to manage Jenkins-à manage plugins
Search for Git plugin and install plugin.
After installing Git plugin, we need to add Jenkins URL in Git webhooks.
Go to repository settings and click on webhook and add Jenkins URL.
Click on webhooks and add webhook Jenkins URL and save.
Now we can integrate Git with Jenkins to push changes from Git to Jenkins for our project.
STEP6:
Now we need to provide all the details, since it’s time to build the code. The settings under the build section will help you build the code at the time you want.
- Click on “Add build step”
- Select “execute windows or shell command”
- Now execute project code in shell.
- click on save and apply.
- Build code
STEP 7:
Since we are done with Build, we need to check console output.
Conclusion:
Jenkins is a “DevOps” open-source project written in Java that runs on Windows, macOS, and other Unix-like operating systems. It’s free, community-supported, and might be your first-choice tool for continuous integration. Primarily deployed on-premises, Jenkins can run on cloud servers as well.
Compared to other CI tools price, integration and use cases, it supports all operating systems.
Hope this article will help to learn Jenkins.
Written by Jagadeesh
Useful article for me to learn devops tool. Thank you.
Great article on Jenkins CI
Great article,
Helps me to understand basics to learn Jenkins and installation about Ec2. Thanks a lot.
Thanks for writing this content. Step by step procedure with the screenshots made is simple to understand. Please make a content on CI/CD,Docker, GitHub and more useful stuff.
Easy to understand and learn all about Jenkins in one go. Great article best to do more blogs on other Devops Tools.
Great article,
Helped understanding me Devops basics and what is Jenkins and installations on cloud. Need more articles on other tools.
This is an Amazing article, full of information.
Very nice article ,it will help layman who wants to learn Jenkins for first time.
Best article…
For beginners it is very good.
Great work..Very informative and easy to understand. I basically have zero knowledge about cloud computing but your article gave me a very good understanding..Please make a blog on docker and Amazon web services…Keep up the good work…Thanks
Great information for those who want to learn Jenkins basics step by step process.
Nice article
Nice article it is very useful for me to learn devops Jenkins
I just could not leave your site prior to suggesting that I really loved the usual information a person provide to your visitors? Is gonna be again steadily to check out new posts
I’m impressed, I need to say. Actually rarely do I encounter a blog that’s each educative and entertaining, and let me tell you, you might have hit the nail on the head. Your idea is excellent; the problem is one thing that not sufficient people are speaking intelligently about. I am very completely happy that I stumbled across this in my search for something relating to this.
There are definitely a variety of details like that to take into consideration. That may be a nice point to convey up. I offer the ideas above as general inspiration however clearly there are questions just like the one you carry up where an important thing shall be working in sincere good faith. I don?t know if finest practices have emerged around issues like that, however I am positive that your job is clearly identified as a good game. Each boys and girls feel the impact of only a second’s pleasure, for the rest of their lives.
Very interesting information!Perfect just what I was searching for!
I like this web blog very much, Its a really nice place to read and incur information.
Hey, Thanks for the wonderful feedback! We’re glad you found the blog useful.
Really fantastic visual appeal on this website , I’d value it 10 10.
Very great post. I just stumbled upon your blog and wished to say that I have really enjoyed surfing around your weblog posts. After all I’ll be subscribing for your rss feed and I’m hoping you write once more very soon!
Hey , thanks for checking out the blog. I’m glad you liked it. I’ll be publishing the next blog in the series very soon. Cheers!
Hello there! Would you mind if I share your blog with my twitter group? There’s a lot of people that I think would really enjoy your content. Please let me know. Many thanks
Hello there! Thanks for your feedback, we are glad you found our blog useful.
You can definitely share this blog on you twitter, you can also check our courses on Simpliv for your devops learning requirements.
I really like your writing style, great info, thanks for posting :D. “Faith is a continuation of reason.” by William Adams.
Hello, you used to write fantastic, but the last several posts have been kinda boring?K I miss your super writings. Past several posts are just a little bit out of track! come on!
Hey , thanks for checking out the blog. I’m glad you liked it. I’ll be publishing the next blog in the series very soon. Please subscribe to our blog to stay posted. Cheers!
I like this weblog so much, saved to favorites. “Respect for the fragility and importance of an individual life is still the mark of an educated man.” by Norman Cousins.
Keep functioning ,splendid job!
Good ?V I should certainly pronounce, impressed with your website. I had no trouble navigating through all tabs and related info ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Reasonably unusual. Is likely to appreciate it for those who add forums or something, web site theme . a tones way for your client to communicate. Nice task..
I am impressed with this website , really I am a fan.
Great write-up, I¦m normal visitor of one¦s blog, maintain up the excellent operate, and It is going to be a regular visitor for a long time.
Have you ever thought about writing an e-book or guest authoring on other sites? I have a blog based on the same topics you discuss and would really like to have you share some stories/information. I know my readers would appreciate your work. If you’re even remotely interested, feel free to send me an e-mail.
Thanks for this post, I am a big fan of this web site would like to proceed updated.
tarot card meanings list https://ericsundwall.com/tarot-card-reading-and-meanings/ Ericsundwall.com tarot cards reading
hello there and thank you for your info – I have definitely picked up something new from right here. I did however expertise some technical points using this web site, as I experienced to reload the site a lot of times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I am complaining, but sluggish loading instances times will very frequently affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Well I’m adding this RSS to my email and can look out for much more of your respective exciting content. Ensure that you update this again very soon..
Do you have a spam problem on this website; I also am a blogger, and I was curious about your situation; we have created some nice practices and we are looking to swap methods with others, please shoot me an e-mail if interested.
Keep functioning ,great job!
Very interesting info !Perfect just what I was looking for!
Woah! I’m really loving the template/theme of this website. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between user friendliness and visual appeal. I must say you’ve done a superb job with this. Also, the blog loads extremely quick for me on Chrome. Excellent Blog!
Good article, It helps a lot who is new with jenkins.
Wow, amazing blog structure! How lengthy have you been blogging for? you make running a blog glance easy. The whole glance of your web site is magnificent, as well as the content material!
I conceive this website holds some rattling great info for everyone. “He is able who thinks he is able.” by Buddha.
I genuinely prize your piece of work, Great post.
Thank you for another informative website. Where else could I get that kind of information written in such an ideal way? I’ve a project that I’m just now working on, and I’ve been on the look out for such information.
It is perfect time to make some plans for the future and it’s time to be happy. I have read this post and if I could I wish to suggest you few interesting things or suggestions. Maybe you can write next articles referring to this article. I desire to read even more things about it!
Hiya, I am really glad I have found this information. Today bloggers publish just about gossip and net stuff and this is really irritating. A good website with exciting content, that’s what I need. Thanks for making this website, and I will be visiting again. Do you do newsletters by email?
Have you ever considered writing an e-book or guest authoring on other blogs? I have a blog based on the same information you discuss and would love to have you share some stories/information. I know my viewers would appreciate your work. If you are even remotely interested, feel free to shoot me an e mail.
I’m not sure where you are getting your information, but great topic. I needs to spend some time learning more or understanding more. Thanks for magnificent information I was looking for this information for my mission.
My spouse and I absolutely love your blog and find most of your post’s to be just what I’m looking for. can you offer guest writers to write content for you personally? I wouldn’t mind writing a post or elaborating on many of the subjects you write regarding here. Again, awesome weblog!
Thank you for sharing excellent informations. Your web site is so cool. I’m impressed by the details that you have on this site. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my friend, ROCK! I found just the info I already searched everywhere and simply could not come across. What a great website.
I haven?¦t checked in here for some time since I thought it was getting boring, but the last few posts are great quality so I guess I?¦ll add you back to my daily bloglist. You deserve it my friend 🙂
very good publish, i definitely love this website, keep on it
I really appreciate this post. I?¦ve been looking all over for this! Thank goodness I found it on Bing. You’ve made my day! Thanks again
I really appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thank you again
I haven’t checked in here for a while as I thought it was getting boring, but the last several posts are great quality so I guess I’ll add you back to my daily bloglist. You deserve it my friend ?
Very efficiently written information. It will be supportive to everyone who employess it, including me. Keep doing what you are doing – looking forward to more posts.
Hi there. I found your web site via Google whilst looking for a similar topic, your site came up. It seems great. I have bookmarked it in my google bookmarks to visit then.