Jenkins on cloud

1-click AWS Deployment    1-click Azure Deployment

1-click Google Deployment

Overview

Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate Jenkins with a number of testing and deployment technologies.Jenkins is free and is entirely written in Java. Jenkins is a widely used application around the world that has around 300k installations and growing day by day.

It is a server-based application and requires a web server like Apache Tomcat. The reason Jenkins became so popular is that of its monitoring of repeated tasks which arise during the development of a project. For example, if your team is developing a project, Jenkins will continuously test your project builds and show you the errors in early stages of your development.

By using Jenkins, software companies can accelerate their software development process, as Jenkins can automate build and test at a rapid rate. Jenkins supports the complete development lifecycle of software from building, testing, documenting the software, deploying and other stages of a software development lifecycle.

Jenkins Architecture

 

Jenkins Standalone Architecture - What is Jenkins - Edureka

This single Jenkins server was not enough to meet certain requirements like:

  • Sometimes you might need several different environments to test your builds. This cannot be done by a single Jenkins server.
  • If larger and heavier projects get built on a regular basis then a single Jenkins server cannot simply handle the entire load.

To address the above stated needs, Jenkins distributed architecture was introduced.

Jenkins Distributed Architecture

Jenkins uses a Master-Slave architecture to manage distributed builds. In this architecture, Master and Slave communicate through TCP/IP protocol.

Jenkins Master

Your main Jenkins server is the Master. The Master’s job is to handle:

  • Scheduling build jobs.
  • Dispatching builds to the slaves for the actual execution.
  • Monitor the slaves (possibly taking them online and offline as required).
  • Recording and presenting the build results.
  • A Master instance of Jenkins can also execute build jobs directly.

Jenkins Slave

A Slave is a Java executable that runs on a remote machine. Following are the characteristics of Jenkins Slaves:

  • It hears requests from the Jenkins Master instance.
  • Slaves can run on a variety of operating systems.
  • The job of a Slave is to do as they are told to, which involves executing build jobs dispatched by the Master.
  • You can configure a project to always run on a particular Slave machine, or a particular type of Slave machine, or simply let Jenkins pick the next available Slave.

The diagram below is self explanatory. It consists of a Jenkins Master which is managing three Jenkins Slave.

Jenkins Distributed Architecture - Jenkins Tutorial - Edureka

Now let us look at an example in which Jenkins is used for testing in different environments like: Ubuntu, MAC, Windows etc.

The diagram below represents the same:

Distributed Testing - Jenkins Tutorial - Edureka

Course Curriculum

DevOps Certification Training

  • Instructor-led Sessions
  • Real-life Case Studies
  • Assignments
  • Lifetime Access

The following functions are performed in the above image:

  • Jenkins checks the Git repository at periodic intervals for any changes made in the source code.
  • Each builds requires a different testing environment which is not possible for a single Jenkins server. In order to perform testing in different environments Jenkins uses various Slaves as shown in the diagram.
  • Jenkins Master requests these Slaves to perform testing and to generate test reports.

Jenkins Build Pipeline

It is used to know which task Jenkins is currently executing. Often several different changes are made by several developers at once, so it is useful to know which change is getting tested or which change is sitting in the queue or which build is broken. This is where pipeline comes into picture. The Jenkins Pipeline gives you an overview of where tests are up to. In build pipeline the build as a whole is broken down into sections, such as the unit test, acceptance test, packaging, reporting and deployment phases. The pipeline phases can be executed in series or parallel, and if one phase is successful, it automatically moves on to the next phase (hence the relevance of the name “pipeline”).The below image shows how a multiple build Pipeline looks like.

Jenkins Build Pipeline - Jenkins Tutorial - Edureka

Hope you have understood the theoretical concepts. Now, let’s have some fun with hands-on.

Now we  will create a new job in Jenkins, it is a Freestyle Project. However, there are 3 more options available. Let us look at the types of build jobs available in Jenkins.

Freestyle Project:

Freestyle build jobs are general-purpose build jobs, which provides maximum flexibility. The freestyle build job is the most flexible and configurable option, and can be used for any type of project. It is relatively straightforward to set up, and many of the options we configure here also appear in other build jobs.

 Multiconfiguration Job:

The “multiconfiguration project” (also referred to as a “matrix project”) allows you run the same build job on different environments. It is used for testing an application in different environments, with different databases, or even on different build machines.

Monitor an External Job:

The “Monitor an external job” build job lets you keep an eye on non-interactive processes, such as cron jobs.

Maven Project:

The “maven2/3 project” is a build job specially adapted to Maven projects. Jenkins understands Maven pom files and project structures, and can use the information gleaned from the pom file to reduce the work you need to do to set up your project.

What is Continuous Integration?

In Continuous Integration after a code commit, the software is built and tested immediately. In a large project with many developers, commits are made many times during a day. With each commit code is built and tested. If the test is passed, build is tested for deployment. If deployment is a success, the code is pushed to production. This commit, build, test, and deploy is a continuous process and hence the name continuous integration/deployment.

A Continuous Integration Pipeline is a powerful instrument that consists of a set of tools designed to hostmonitorcompile and test code, or code changes, like:

  • Continuous Integration Server (Jenkins, Bamboo, CruiseControl, TeamCity, and others)
  • Source Control Tool (e.g., CVS, SVN, GIT, Mercurial, Perforce, ClearCase and others)
  • Build tool (Make, ANT, Maven, Ivy, Gradle, and others)
  • Automation testing framework (Selenium, Appium, TestComplete, UFT, and others)

Jenkin History

  • Kohsuke Kawaguchi, a Java developer, working at SUN Microsystems, was tired of building the code and fixing errors repetitively. In 2004, created an automation server called Hudson that automates build and test task.
  • In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson open source community, so they forked Hudson and renamed it as Jenkins.
  • Both Hudson and Jenkins continued to operate independently. But in short span of time, Jenkins acquired a lot of projects and contributors while Hudson remained with only 32 projects. With time, Jenkins became more popular, and Hudson is not maintained anymore.

Why use Continuous Integration with Jenkins?

Some people might think that the old-fashioned way of developing the software is the better way. Let’s understand the advantages of CI with Jenkins with the following exampleLet us imagine, that there are around 10 developers who are working on a shared repository. Some developer completes their task in 25 days while others take 30 days to complete.

Before Jenkins After Jenkins
Once all Developers had completed their assigned coding tasks, they used to commit their code all at same time. Later, Build is tested and deployed.

Code commit built, and test cycle was very infrequent, and a single build was done after many days.

The code is built and test as soon as Developer commits code. Jenkin will build and test code many times during the day

If the build is successful, then Jenkins will deploy the source into the test server and notifies the deployment team.

If the build fails, then Jenkins will notify the errors to the developer team.

Since the code was built all at once, some developers would need to wait until other developers finish coding to check their build The code is built immediately after any of the Developer commits.
It is not an easy task to isolate, detect, and fix errors for multiple commits. Since the code is built after each commit of a single developer, it’s easy to detect whose code caused the built to fail
Code build and test process are entirely manual, so there are a lot of chances for failure. Automated build and test process saving timing and reducing defects.
The code is deployed once all the errors are fixed and tested. The code is deployed after every successful build and test.
Development Cycle is slow The development cycle is fast. New features are more readily available to users. Increases profits.

Real-world case study of Continuous Integration

I am sure all of you aware of old phone Nokia. Nokia used to implement a procedure called nightly build. After multiple commits from diverse developers during the day, the software built every night. Since the software was built only once in a day, it’s a huge pain to isolate, identify, and fix the errors in a large code base.

Later, they adopted Continuous Integration approach. The software was built and tested as soon as a developer committed code. If any error is detected, the respective developer can quickly fix the defect.

Jenkins Plugins

By default, Jenkins comes with a limited set of features. If you want to integrate your Jenkins installation with version control tools like Git, then you need to install plugins related to Git. In fact, for integration with tools like Maven, Amazon EC2, you need to install respective plugins in your Jenkins.

Plugins integration in Jenkins

Advantages of using Jenkins

  • Jenkins is being managed by the community which is very open. Every month, they hold public meetings and take inputs from the public for the development of Jenkins project.
  • So far around 280 tickets are closed, and the project publishes stable release every three months.
  • As technology grows, so does Jenkins. So far Jenkins has around 320 plugins published in its plugins database. With plugins, Jenkins becomes even more powerful and feature rich.
  • Jenkins also supports cloud-based architecture so that you can deploy Jenkins in cloud-based platforms.
  • The reason why Jenkins became popular is that it was created by a developer for developers.

Disadvantages of using Jenkins

Though Jenkins is a very powerful tool, it has its flaws.

  • Its interface is out dated and not user friendly compared to current UI trends.
  • Though Jenkins is loved by many developers, it’s not that easy to maintain it because Jenkins runs on a server and requires some skills as server administrator to monitor its activity.
  • One of the reasons why many people don’t implement Jenkins is due to its difficulty in installing and configuring Jenkins.
  • Continuous integrations regularly break due to some small setting changes. Continuous integration will be paused and therefore requires some developer attention.

How to Download & Install Jenkins on Windows

Jenkins may be installed on either Windows or Unix platforms, but we will focus on Windows installation only.

Prerequisites:Before you proceed to install Jenkins in your windows system, there are some prerequisites for Jenkins to install Jenkins in your computer.

Hardware requirements:

  • You need minimum 256 MB of RAM in your computer or laptop to install Jenkins
  • You need at least 1 GB of space in your hard drive for Jenkins.

Software Requirements:

  • Since Jenkins runs on Java, you need either latest version of Java Development Kit (JDK) or Java Runtime Environment (JRE).

Release Types

Jenkins releases two types of versions based on the organization needs.

  • Long-term support release
  • Weekly release

Long term support release (LTS) :

Long-term support releases are available every 12 weeks. They are stable and are widely tested. This release is intended for end users.

Weekly release:

Weekly releases are made available every week by fixing bugs in its earlier version. These releases are intended towards plugin developers.

We will use the LTS release though the process remains the same for Weekly release.

How to Download Jenkins?

Following steps should be followed so that to install Jenkins successfully:

Step 1) Got to https://jenkins.io/download/ and select the platform. In our case Windows

Step 2) Go to download location from local computer and unzip the downloaded package. Double-click on unzipped jenkins.msi. You can also Jenkin using a WAR (Web application ARchive) but that is not recommended.

Step 3) In the Jenkin Setup screen, click Next.

Step 4) Choose the location where you want to have the Jenkins instance installed (default location is C:\Program Files (x86)\Jenkins), then click on Next button.

Step 5)Click on the Install button.

Step 6) Once install is complete, click Finish.

Step 7) During the installation process an info panel may pop-up to inform the user that for a complete setup, the system should be rebooted at the end of the current installation. Click on OK button when the Info panel is popping-up:

How to Unblock Jenkins?

After completing the Jenkins installation phase, you should proceed further and start its configuration. Next steps will guide you how you can unblock Jenkins application:

Step 1) After completing the Jenkins installation process, a browser tab will pop-up asking for the initial Administrator password. To access Jenkins, you need to go to browse the following path in your web browser.

http://localhost:8080

If you can access the above URL, then it confirms that Jenkins is successfully installed in your system.

Step 2) The initial Administrator password should be found under the Jenkins installation path (set at Step 4 in Jenkins Installation).For default installation location to C:\Program Files (x86)\Jenkins, a file called initialAdminPassword can be found under C:\Program Files (x86)\Jenkins\secrets.

However, If a custom path for Jenkins installation was selected, then you should check that location for initialAdminPassword file.

Step 3) Open the highlighted file and copy the content of the initialAdminPassword file.

Step 4) Paste the password it into browser’s pop-up tab (http://localhost:8080/login?form=%2F) and click on Continue button.

Customize Jenkins

You can also customize your Jenkins environment by below-given steps:

Step 1) Click on the “Install suggested plugins button” so Jenkins will retrieve and install the essential plugins

Jenkins will start to download and install all the necessary plugins needed to create new Jenkins Jobs.

You can choose the Option “Select Plugins to Install” and select the plugins you want to install

Step 2) After all suggested plugins were installed, the “Create First Admin User” panel will show up. Fill all the fields with desired account details and hit the “Save and Finish” button.

Step 3) Once you have filled the above data, finally it will ask for URL information where you can configure the default instance path for Jenkins. Leave it as it is to avoid any confusions later. However, if another application is already using 8080 port, you can use another port for Jenkins and finally save the settings, and you are done with installation of Jenkins. Hit the “Save and Continue” button:

Congratulations! We have successfully installed a new Jenkins Server. Hit the “Start using Jenkins” button.

Below you can find the Jenkins instance up and run, ready to create first Jenkins jobs:

How to Create Users & Manage Permissions: Role Strategy Plugin

In a large organization, there are multiple, separate teams to manage and run jobs in Jenkins. But managing this crowd of users and assigning roles to them can prove troublesome.By default, Jenkins comes with very basic user creation options. You can create multiple users but can only assign the same global roles and privileges to them. This not ideal, especially for a large organization.The Role Strategy Plugin enable you to assign different roles and privileges to different users. You will first need to install the plugin in your Jenkins mange environment.

How to Create/Add a User

Step 1) Login to your Jenkins dashboard by visiting http://localhost:8080/

If you haven’t installed Jenkins in your local server, go to the appropriate URL and access your dashboard by using your login credentials.

Step 2) You will now see options to create new users and manage current users.

Step 3)

  • Under Manage Jenkins, Click Create User
  • Enter User details like password, name, email etc.
  • Click Create User

Step 4) User is created

Install Role Strategy Plugin

There are two methods for installing plugins in Jenkins:

  1. Installing it through your Jenkins dashboard
  2. Downloading the plugin from Jenkins website and installing it manually.

Step 1)

1. Go to Manage Jenkins

2. Click on the Manage Plugins option

Step 2)

  1. In available section, screen Search for “role”.
  2. Select Role-based Authorization Strategy plugin
  3. Click on “Install without restart” (make sure you have an active internet connection)

Step 3)

Once the plugin is installed, a “success” status will be displayed.

Click on Go back to the top page.

Step 4) Go to Manage Jenkins -> Configure Global Security -> Under Authorization, select Role Based Strategy. Click on Save.

Create Roles

In this step, we shall learn to certain roles to a single user or a group of users.

Step 1)

1. Go to Manage Jenkins

2. Select Manage and Assign Roles

Note: that the Manage and Assign Roles option will only be visible if you’ve installed the role strategy plugin.

Step 2) Click on Manage Roles to add new roles based on your organization.

Step 3) To create a new role called “developer”,

  1. Type “developer” under “role”.
  2. Click on “Add” to create a new role.
  3. Now, select the permissions you want to assign to the “Developer” role.
  4. Click Save

Assign a Role

Step 1) Now that you have created roles, let us assign them to specific users.

  1. Go to Manage Jenkins
  2. Select Manage and Assign Roles

Step 2) We shall add the new role “developer” to user “guru99

  1. Selector developer role checkbox
  2. Click Save

You can assign any role to any user, as per your need.

Project Roles

You can create project specific roles under Project Roles.

Step 1) In Jenkin’s Manage and Assign Roles

  1. Enter a role as “tester”
  2. Add a pattern to this by adding tester.*, so that any username starting with “tester” will be assigned the project role you specify.
  3. Click Add
  4. Select privileges
  5. Click Save

 

Jenkins – Unit Testing

Jenkins provides an out of box functionality for Junit, and provides a host of plugins for unit testing for other technologies, an example being MSTest for .Net Unit tests.

Unit TestingUnit Testing Plugins

Example of a Junit Test in Jenkins

The following example will consider

  • A simple HelloWorldTest class based on Junit.
  • Ant as the build tool within Jenkins to build the class accordingly.

Step 1 − Go to the Jenkins dashboard and Click on the existing HelloWorld project and choose the Configure option

Junit Test Example

Step 2 − Browse to the section to Add a Build step and choose the option to Invoke Ant.

Invoke Ant

Step 3 − Click on the Advanced button.

Advanced Button

Step 4 − In the build file section, enter the location of the build.xml file.

XML Location

Step 5 − Next click the option to Add post-build option and choose the option of “Publish Junit test result report”

Publish Junit Report

Step 6 − In the Test reports XML’s, enter the location as shown below. Ensure that Reports is a folder which is created in the HelloWorld project workspace. The “*.xml” basically tells Jenkins to pick up the result xml files which are produced by the running of the Junit test cases. These xml files which then be converted into reports which can be viewed later.

Once done, click the Save option at the end.

Report Test XML

Step 7 − Once saved, you can click on the Build Now option.

Once the build is completed, a status of the build will show if the build was successful or not. In the Build output information, you will now notice an additional section called Test Result. In our case, we entered a negative Test case so that the result would fail just as an example.

Build Option

One can go to the Console output to see further information. But what’s more interesting is that if you click on Test Result, you will now see a drill down of the Test results.

Test Result

Jenkins – Automated Testing

One of the basic principles of Continuous Integration is that a build should be verifiable. You have to be able to objectively determine whether a particular build is ready to proceed to the next stage of the build process, and the most convenient way to do this is to use automated tests. Without proper automated testing, you find yourself having to retain many build artifacts and test them by hand, which is hardly in the spirit of Continuous Integration. The following example shows how to use Selenium to run automated web tests.

Step 1 − Go to Manage Plugins.

Automated Testing

Step 2 − Find the Hudson Selenium Plugin and choose to install. Restart the Jenkins instance.

Hudson Selenium Testing

Step 3 − Go to Configure system.

Configure System

Step 4 − Configure the selenium server jar and click on the Save button.

Configure Selenium Server

Note − The selenium jar file can be downloaded from the location SeleniumHQ

Click on the download for the Selenium standalone server.

Download Selenium Standalone Server

Step 5 − Go back to your dashboard and click on the Configure option for the HelloWorld project.

Configure

Step 6 − Click on Add build step and choose the optin of “SeleniumHQ htmlSuite Run”

SeleniumHQ htmlSuite Run

Step 7 − Add the necessary details for the selenium test. Here the suiteFile is the TestSuite generated by using the Selenium IDE. Click on Save and execute a build. Now the post build will launch the selenium driver, and execute the html test.

Selenium Driver HTML test

Jenkins – Reporting

In Jenkins, a report is a structured and graphical way where we can see the execution results or output of the test. Reports are also useful when we have to communicate the results with our team members or with other stakeholders. There are many plugins available for reporting in Jenkins. It is easy, convenient, and recommended.In Jenkins, Test results are generated in the form of Graphical Reports. These reports are just not graphical but can produce the detail written reports. This written report can be in different formats, and we can manage it by specifying along with the build command.

  • In the Post-build action for any job, you can define the reports to be created. To do that, go to your job -> configure.

Jenkins Reporting

  • Scroll down and click on Post-build action button and select Publish JUnit test result report option.

Jenkins Reporting

  • On the Test reports XMLs section, enter the path of the file.

Jenkins Reporting

  • Click on Apply then Save button.
  • Now click on the Build Now to build the project again.
  • In the “Build history” section, select the build and open up the build results.
  • Click on Test Result.

Jenkins Reporting

  • When you click on Test Result option, then you can see the test results which are simple, beautiful, and easy to understand.As you can see, the below report is so much understandable than the XML code.

Here, you can see the number of passed tests and the number of failed tests. If your test fails, it will be displayed in red color.

Jenkins – Reporting

In Jenkins, a report is a structured and graphical way where we can see the execution results or output of the test. Reports are also useful when we have to communicate the results with our team members or with other stakeholders. There are many plugins available for reporting in Jenkins. It is easy, convenient, and recommended.

In Jenkins, Test results are generated in the form of Graphical Reports. These reports are just not graphical but can produce the detail written reports. This written report can be in different formats, and we can manage it by specifying along with the build command.

  • In the Post-build action for any job, you can define the reports to be created. To do that, go to your job -> configure.

Jenkins Reporting

  • Scroll down and click on Post-build action button and select Publish JUnit test result report option.

Jenkins Reporting

  • On the Test reports XMLs section, enter the path of the file.

Jenkins Reporting

  • Click on Apply then Save button.
  • Now click on the Build Now to build the project again.
  • In the “Build history” section, select the build and open up the build results.
  • Click on Test Result.

Jenkins Reporting

  • When you click on Test Result option, then you can see the test results which are simple, beautiful, and easy to understand.

As you can see, the below report is so much understandable than the XML code.

Jenkins Reporting

Here, you can see the number of passed tests and the number of failed tests. If your test fails, it will be displayed in red color.

-Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle.Jenkins provides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clear case and RTC and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands. The primary developer of Jenkins is Kohsuke Kawaguchi. Released under the MIT License, Jenkins is free software.
Builds can be started by various means, including being triggered by commit in a version control system, by scheduling viae a cron-like mechanism, by building when other builds have completed and by requesting a specific build URL.

Jenkins is a cross-platform, continuous integration and continuous delivery application that increases your productivity. Use Jenkins to build and test your software projects continuously making it easier for developers to integrate changes to the project and making it easier for users to obtain a fresh build. It also allows you to continuously deliver your software by providing powerful ways to define your build pipelines and integrating with a large number of testing and deployment technologies.

Jenkins is owned by Jenkins (https://jenkins.io/) and they own all related trademarks and IP rights for this software.

Cognosys Provides Hardened images of Jenkins on the cloud ( AWS marketplace, Azure and Google Cloud Platform).

Deploy Jenkins securely on cloud i.e. AWS marketplaceAzure and Google Cloud Platform (GCP)

Secured Jenkins on Ubuntu 14.04 LTS

Features

Top 10 Jenkins Plugins and Features

Here is a list of my own and the team’s top 10 must-have Jenkins plugins and features:

  • Pipeline
  • Easy Installation
  • Easy Upgrades
  • Scriptability
  • View Filters
  • Maven
  • Amazon EC2
  • HTML Publisher
  • Throttle Builds
  • Join
  • Green Balls

Pipeline

Jenkins Pipeline is an incredibly useful addition that came to life with the Jenkins 2.0 release. It allows you to script your build pipeline consisting of one or more build jobs into a single workflow. It makes the visualization of the pipeline much easier, the monitoring of which parts have been run and which jobs are still in the queue a non-issue.

The best part is that it’s integrated with the SCM, so you can develop your pipeline definition script using proper tools and see the historical changes, audit, do the code reviews, etc. The build pipeline can become the essential part of your mental model about the CI.

image of build pipeline using jenkins plugins

And with the pipeline plugin it is not easier to achieve than before. The image above is taken from the CloudBees blog, where you can read more about the best practices of using the pipeline plugin!

Easy Installation

Jenkins comes as a WAR file (there are also a wide variety of Linux packages available and a Windows installer) that you can drop into your favourite JEE container (Tomcat, Jetty, Glassfish etc.) or you can start the WAR file directly with java -jar jenkins.war. That’s it!

Now that it is up and running, you can start configuring jobs and installing plugins. It will use a folder in your $HOME to persist the configuration and store the actual jobs. No database, no special installation, no special registration. Clean and easy. You can even easily chain the job executions and visualize the whole pipeline of multiple jobs.

Easy Upgrades

Jenkins has very quick release cycles, and statistics shows that there is a release for every 6.59 days. The release process page will state that an RC freeze is schedules for Monday, and then late Friday the RC is released. Also, there is a Long-term Support version available that is put together every 3 months and is suitable for more stable installations.The upgrade process itself is super easy. It does not matter if you are using Linux, Mac OS or Windows; there is a single, easy way for upgrades built into the product itself.

 

Scriptability

Jenkins provides different means to communicate with it. There is a web-based GUI that everyone is accustomed to, the command line interface and also a Rest API for Python, XML and JSON. You can feel that this Jenkins plugin is a tool from developers for developers. For example, to iterate through all jobs available in a Jenkins installation, all you need in Python is 3 lines of code.

import urllib

obj = eval(urllib.urlopen("http://ci.jenkins-ci.org/api/python").read());
for job in obj['jobs']:
   print job['name']

To generate a graph relationship of all your jobs in your installation, you don’t need much more code (mind the configurability and usability sections).

View Filters

Once you get a large number of jobs in your installation (we have about 200 defined), you will want to organize them so that the right people can get a quick grasp of the current status of the builds in which they are interested. This is where the little plus sign (+) comes to work. You are able to construct views for your branches, projects and persons that will list only a subset of your jobs. The subset can be defined either by a regular expression or explicit project selection.

 

Amazon EC2

One of the little-mentioned Jenkins features, which I think is totally taken for granted, is its ability to scale out to a large number of nodes and distribute the workload between them. If your own infrastructure is not large enough, then this plugin lets you tap into the resources of the Amazon EC2 infrastructure. You can specify the AMIs to use, label them, provide connection credentials and test the connectivity.We use EC2 to run our JEE container tests. This means that to test WebSphere 7.0.1 we launch the specific AMI and start up WebSphere with our agent (XRebel or JRebel) and go through the test suite. This is orchestrated by Jenkins using this plugin and then copying back the results.

Maven 2 Project

This plugin allows you  take advantage of Maven’s features. Jenkins reads your project’s dependencies from your POM and, if those are also built on Jenkins, sets up triggers in such a way that a new build in one of those dependencies will automatically start a new build in this project. Jenkins understands all kinds of dependencies in POM, namely:

  • parent POM
  • <dependencies> section of your project
  • <extensions> section of your project
  • <reporting> section of your project

This process takes versions into account, so you can have multiple versions/branches in your project on the same Jenkins instance and it will correctly determine dependencies. Of course, there are over 20 plugins listed under the Maven section of the Jenkins Plugins Page.

 

HTML Publisher

This plugin is handy with built-in copy to master functionality. Imagine that you have some files generated through your builds that are not actual artifacts. Let’s say logs, debug info, obfuscation maps and whatnot. This plugin lets you to copy them to a master and provide an easy HTML file that will have links to these special files of yours for really quick access.

 

Copy Artifact

If you are not using a dependency management system, your build jobs become isolated as they do not know anything about each other. This Jenkins plugin helps to solve this problem by allowing you to copy needed files from one job to another. So it may be handy to copy a resulting artifact from one build job into another job that will run tests against it. It does sound a bit hackish, but it is way better than referencing your artifacts from one job folder to another.

Jenkins Throttle Concurrent Builds

I am pretty sure that you have some jobs running in Jenkins that should not interfere with each other. This plugin allows you to group jobs, and allow only some defined number of jobs run concurrently (in most cases, it is one) in the same environment. Take test jobs that use some container instances preinstalled on your master/slaves, for example: this plugin allows you to configure your jobs so that they will run on different slaves or wait for another job to finish before starting.

Join

This plugin allows a job to be run after all the immediate downstream jobs have completed. In this way, the execution can branch out and perform many steps in parallel, and then run a final aggregation step just once after all the parallel work is finished. This plugin is useful for creating a diamond shape project dependency. This means there is a single parent job that starts several downstream jobs. Once those jobs are finished, a single aggregation job runs. Unfortunately, more complex interactions are not possible with this plugin.Your time is too valuable to sit around waiting for your code to redeploy.

Green Balls

Historically Jenkins has used the blue color to denote successful builds. So, all status messages throughout the GUI use blue as the color of success. I don’t know the history of this, but closest thing that comes to mind is the The Matrix, where the blue pill was designated as the safe choice. If you are like me and feel that green is the way to go (Green Hornet, Green Lantern, Gumby, traffic lights, etc) then you can change your preference to green with the Green Balls plugin.

-Major Features of Jenkins :

Easy installation: Just run java -jar jenkins.war, deploy it in a servlet container. No additional install, no database. Prefer an installer or native package? We have those as well.
Easy configuration: Jenkins can be configured entirely from its friendly web GUI with extensive on-the-fly error checks and inline help.
Rich plugin ecosystem: Jenkins integrates with virtually every SCM or build tool that exists.
Extensibility: Most parts of Jenkins can be extended and modified and it’s easy to create new Jenkins plugins. This allows you to customize Jenkins to your needs.
Distributed builds: Jenkins can distribute build/test loads to multiple computers with different operating systems. Building software for OS X, Linux and Windows? No problem.

Azure

Installation Instructions For Ubuntu

Note : How to find PublicDNS in Azure

Step 1) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Ubuntu instance on Azure Cloud

1) Download Putty.

2) Connect to the virtual machine using following SSH credentials:

  • Hostname: PublicDNS  / IP of machine
  • Port: 22

Username: Your chosen username when you created the machine ( For example:  Azureuser)

Password: Your Chosen Password when you created the machine ( How to reset the password if you do not remember)

unlock jenkins

Step 2) Application URL: Access the Web Interface via a browser at http://<your ip>:8080

Note: Get Admin password with cat/var/lib/jenkins/secrets/initialAdminPassword

Step 3) Other Information:

1. Default installation path: will be in your web root folder “/var/www/html/”
2. Default ports:

    • Http: 8080


Configure custom inbound and outbound rules using this link

3. To access Webmin interface for management please follow this link

Installation Instructions For Centos

Note : How to find PublicDNS in Azure

Step 1) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Ubuntu instance on Azure Cloud

1) Download Putty.

2) Connect to the virtual machine using following SSH credentials:

  • Hostname: PublicDNS  / IP of machine
  • Port: 22

Username: Your chosen username when you created the machine ( For example:  Azureuser)

Password: Your Chosen Password when you created the machine ( How to reset the password if you do not remember)

unlock jenkins

Step 2) Application URL: Access the Web Interface via a browser at http://<your ip>:8080

Note: Get Admin password with cat/var/lib/jenkins/secrets/initialAdminPassword

Step 3) Other Information:

1. Default installation path: will be on your web root folder “/var/www/html/”
2. Default ports:

  • Http: 8080

Configure custom inbound and outbound rules using this link

3. To access Webmin interface for management please follow this link

Step by Step Screenshots:

jenkins dashboard

build history to track details of jenkins

manage settings in jenkins

credentials screen

user type and details

fill details to update user

edit item details

jenkins on cloud on asw azure and google cloud

Google

Installation Instructions For Windows

Step 1) VM Creation:

1.Click the Launch on Compute Engine button to choose the hardware and network settings.
2.You can see at this page, an overview of Cognosys Image as well as some estimated costs of VM.
3.In the settings page, you can choose the number of CPUs and amount of RAM, the disk size and type etc.

Step 2) RDP Connection: To initialize the DB Server connect to the deployed instance, Please follow Instructions to Connect to Windows instance on Google Cloud

Step 3) Database Login Details:

The below screen appears after successful deployment of the image.

successful deployment of the image

For local MySQL root password, please use the temporary password generated automatically during image creation as shown above.

i) Please connect to Remote Desktop as given in step 2 to ensure stack is properly configured and DB is initialized.
ii) You can use MySQL server instance as localhost, username root and password as shown above.

If you have closed the deployment page you can also get the MySQL root password from VM Details  “Custom metadata” Section

Step 4) Application URL: Access the application via a browser at http://<yourip>/jenkins

A) You will see the page where you can configure your site data with site name, jenkins admin name etc.

B) On next page you will see configuration success message.

C) You can login to the jenkins admin portal with the jenkins username and its generated password from point A shown above.

D) You can access the configured site at http://yourIP/jenkins

Installation Instructions For Redhat

Step 1) VM Creation:

  1. Click the Launch on Compute Engine button to choose the hardware and network settings.         
  2. You can see at this page, an overview of Cognosys Image as well as some estimated costs of VM.                                                                                                                                                   
  3.  In the settings page, you can choose the number of CPUs and amount of RAM, the disk size and type etc.Step 2) SSH Connection: To connect to the deployed instance, Please follow Instructions to Connect to Ubuntu instance on Google Cloud1) Download Putty.2) Connect to the virtual machine using SSH key
    • Hostname: PublicDNS  / IP of machine
    • Port : 22

    Step 3) Database Login Details:

    The below screen appears after successful deployment of the image.

    successful deployment of the image

    For local MySQL root password, please use the temporary password generated automatically during image creation as shown above.

    i) Please connect to Remote Desktop as given in step 2 to ensure stack is properly configured and DB is initialized.
    ii) You can use MySQL server instance as localhost, username root and password as shown above.

    If you have closed the deployment page you can also get the MySQL root password from VM Details  “Custom metadata” Section

    Step 4) Application URL: Access the application via a browser at http://<yourip>/jenkins

    A) You will see the page where you can configure your site data with site name, jenkins admin name etc.

    B) On next page you will see configuration success message.

    C) You can login to the jenkins admin portal with the jenkins username and its generated password from point A shown above.

    D) You can access the configured site at http://yourIP/jenkins

    Step 5) Other Information:

    1.Default ports:

    • Linux Machines:  SSH Port – 22

    2. To access Webmin interface for management please follow this link

Videos

Secured Jenkins on Ubuntu 14.04 LTS

How to Install Jenkins (Deploying, Upgrade, Apache, Nginx Proxy) in Ubuntu Server 15.10/14.04

Jenkins on cloud

Related Posts