Jenkins Installation & Simple Job Configuration on Ubuntu

Install Jenkins on ubuntu

Install openjdk8

Execute the following commands in order

sudo apt-get update
sudo apt-cache search openjdk

preview

Note: Select any suitable package from the top. This documentation selects the openjdk-8-jdk

sudo apt-get install openjdk-8-jdk

Prepare your system for Jenkins in ubuntu

Execute the following commands

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get update

Before executing install of Jenkins lets try to find the possible Jenkins versions available

sudo apt-cache madison jenkins

preview

Installing Jenkins

sudo apt-get install jenkins  -y

Jenkins Post-Install Configuration

  • Navigate to the url http://<jenkinsserverip&gt;:8080 Preview
  • Find the contents of /var/jenkins_home/secrets/initialAdminPassword and enter in the Administrator Password Textbox and click on continue Preview
  • Now Select the Install Selected plugins in the Customize Jenkins Page Preview
  • Wait till all the plugin installations become successful and then you will be navigated to Create First Admin User Page. Enter the details and click on save and continue Preview

Preview

  • After confirming the instance configuration, You should see the Jenkins is ready page Preview
  • Click on Start using Jenkins Page and you will be redirected to Jenkins home page. Preview

Configure Git, Maven and Build Sample Java Project

  • SSH into Jenkins server and Ensure Git, Maven are installed.

  • In this example lets build game of life from here

  • Click on new Item and select Freestyle project Preview

  • Enter the necessary info in the Description in General Tab and Click on Source Code Management Tab Preview

  • Select Git and Enter the Repository URL and click on Build tab Preview

  • Select Invoke top-level Maven targets after clicking on add build step Preview

  • Enter package in Goals section and click on save. Preview

  • Now Select Build Now and you should see the update in Build History section Preview

  • Click on the Build number as highlighted and select console output to see the build logs Preview

Preview

  • Wait till job is succeded

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner