Jenkins 2.0 has lots of great functionalities that will make the CI pipeline really smooth. One of such example is the DSL based build pipeline. In this guide, i will walk you through the steps for installing and configuring a Jenkins 2 server on a ubuntu 14.04 box.
Install and Configure Jenkins 2.0
Follow the steps given below to install and configure Jenkins 2 on a ubuntu server.
Note: We are doing this installation on a Vagrant Ubuntu 14.04 box.
Note: Centos/Rehat users follow this tutorial Install jenkins 2 on centos/Redhat
1. Log in to the server and update it.
sudo apt-get -y update
2. Install java
sudo apt-get install -y default-jdk
3. Head over to http://pkg.jenkins-ci.org/debian/ and get the download link for Jenkins 2 Ubuntu version and download it using wget command.
4. Install the package
sudo dpkg -i jenkins*
If you face any dependency error while installing the package, you need to execute the following command to rectify it.
sudo apt-get -f install
5. To add Jenkins to the boot menu, open /etc/rc.local file and add the following to the file.
Now you will be able to access the Jenkins server on port 8080 from localhost or using the IP address as shown below.
6. As you can see the above image, you need to provide the administrative password. You can get the password using the following command.
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the password and click continue.
7. Next, you will be asked to configure plugins as shown below. Select “Install Suggested Plugins” option. This will install all the required plugins for building your projects. It will take few minutes to install the plugins.
8. Once installed, You need to create a user with password and click “save and finish”
9. Click “Start Using Jenkins” and it will take you to the Jenkins Dashboard. Log in using the username and password that you have given in step 8.
10. If you want to build java maven project, you need to install maven using the following command.
sudo apt-get install -y maven2
That’s it! Now you have a fully functional Jenkins 2.0 server up and running. Next, would be the configuration of distributed setup wherein you will have a active master and slaves for building the projects.
If you are a docker user, you can Configure Jenkins 2.0 using the following commands.
docker run -p 8080:8080 -p 50000:50000 --name jenkins jenkinsci/jenkins:2.0-rc-1