Jenkins

This article will talk about – what is Jenkins, Installing Jenkins on AWS and why should we be using it. From there, you can take a dig at the advanced features of Jenkins.

What is Jenkins?

Jenkins is a Continuous Integration tool. This provides us with a common platform in the team to build the code in a central place and run automations right after the build. The automation may vary from – placing the artifact in an artifact repository or S3, or just run a deployment script. One thing we should keep in mind is that, Jenkins is a continuous integration tool but not a build tool. It uses maven or ant or any other build plugins to build the code.  It also uses GIT or SVN or other repository plugins to get the actual code.

Jenkins official website – https://jenkins.io/

Installing Jenkins on AWS –

Step 1 – Spin up the ec2 instance

Step 2 – Get Jenkins repo

– wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo

Step 3 – rpm command here imports the key and plays a key role in the jenkins installation

– rpm –import https://pkg.jenkins.io/redhat/jenkins.io.key

Step 4 – now install jenkins using yum

– yum install jenkins -y

Step 5 -Start Jenkins

– service jenkins start

Jenkins needs java 1.8, if you have java versions below that Jenkins will not start.

Upgrade java 1.7 t 1.8

– yum install java-1.8.0 -y

yum remove java-1.7.0-openjdk -y

You can access you Jenkins using this URL – http://ipaddress:8080

If site is loaded, all good.

If the site doesn’t load –

– Check your inbound security group rule for your instance

– On the Inbound tab, add the rules as follows:

1. Click Add Rule, and then choose SSH from the Type list. Under Source, select Custom and in the text box enter the public IP address range that you decided on in step 1.

1.Click Add Rule, and then choose HTTP from the Type list.

2.Click Add Rule, and then choose Custom TCP Rule from the Type list. Under Port Range enter 8080.

Let’s discuss about a few important plugins in Jenkins –

Maven/Ant/Build plugins – These plugins are responsible to build the code with in Jenkins.

GIT/SVN/repo plugin – These plugins are used to connect to the repo which has the actual code in it.

Artifactory plugin – Helps you in connecting to the artifactory once the build is completed.

S3 plugin – To place the artifact in S3 you can use this.

Configuring Jenkins –

In Jenkins, an admin can give vivid roles to different users based on their usage of Jenkins. You can even set the version of build tools, code platform and many others. You can set the timings on when the Jenkins job should run. And many others.

Why Jenkins/Continuous Integration tools?

  • This tool provides a common platform to build the code and keeps track of the builds.
  • You can manually trigger the build, automate it and even schedule it.
  • By default, it provides us with many plugins to integrate with.
  • Does post build kick offs for us.
  • Simple UI, which makes the life of the user better.
  • Open Source Product.
Advertisement

Published by Ritesh Kumar Reddy

I(Ritesh) work as a Sr. Cloud Engineer for a living. Learning new technologies has always been my hobby. Why not share it? Here is the brainchild – blogging to share the knowledge. This blog is for those who wish to start or already into the Cloud field. Each article briefly talks about a tool/technology that is used in the Cloud model. Once you read the article, I hope, you get a kick start regarding the specific tool/technology.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: