Skip to main content

what is jenkins ?

Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks such as building, testing, and deploying software.

Jenkins can be  installed through native system packages, Docker, or even run standalone by any machine with the java Runtime Environment installed.


Is Jenkins is like TFS ?

Well, yes in many ways, since jenkins is a continuous integration tools, but still lacks many other areas where TFS is much more broader than jenkins, since TFS is more of a


  1. Version Control System.
  2. Requirements management system.
  3. Project management system
  4. automated build management system
  5. Testing and release management system.
  6. All, the above is otherwise called as Application Lifecycle Management System.

Part 2 : Installing and getting started with jenkins 2.0

Software pre-requisite 

We need to have following softwares installed before getting started with jenkins 2.0

  1. Java (latest is good)
  2. Jenkins war file
  3. Support tools
  4. Maven 
  5. Nunit
  6. Nuget
  7. Git

For Testing we can integrate plugins like JIRA

How to install jenkins in windows 10 

1) Download war file like LTS. 
to run this jar file we don't require any Database and all we have to run this war file using java.

To test weather java exisit or not 
java -version.


Now go to download directory and run cmd in administration mode 

Note in windows now run this command : C:\jenkins>java -jar jenkins.war

after this command you will get a password at the end of everything. this password is required when you first time start the jenkins.

default port for jenkins is 8080 so now we installed now we have to go to browser

localhost:8080 now jenkins will take you to login page

Now it will ask you Unlock Jenkins

enter password that you copied from cmd. 

After that it will ask you 1) Install suggested plugins 2) Select plugins to install 
so hit the select plugins to install.


while doing this in cmd you will notice a path like C:/Users/Win10/.jenkins/   this is most important folder where jenkins will keep all important file that jenkins required. this is like a database for jenkins this will holds all the plugins in plugins folder that we installed. 

Note: It will also create a project folder for you in this place and keep all the project repository that you complied and build.

Note: If you want to delete jenkins completely then you can delete this folder then it will automatically delete and now you can start from new one.


After Installation complete it will ask you Create First Admin User and will ask basic details like 
1) Username
2) Password
3) Confirm Password 
4) Full Name
5)  Email address.



Part 3 - Configuring Jenkins 2.0

Till now we just installed the plugins but we did not configure anything 

Now we go to Jenkins dashboard 

Click On Manage Jenkins

IN Configure Global Security we can define JNLP agent port so that Jenkins can run multiple jobs in different machines.


Now Go to Manage Jenkins > Global Tools Configuration  this is very important where we are going to do lots of configurations.


Git is used if you want to compile a project from Github then we have to configure this one.

We can also configure JDK 

Note: If environment variable set in Windows Machine, then we don't have to configure these.

Part 4  - Download Common tools used for Jenkins 2.0
  1. Git
  2. Nuget
  3. Maven (After installation set enviromental varibale in machine by defining like M2_Home = C:\tools\apache-maven-3.3.0 and define M2 = C:\tools\apache-maven-3.3.0\bin)
  4. Nunit
Important plugins now download and install git & maven.

After installation go to Global Tool Configuration and go Git and define the name any logical name and path like : C:\ProgramFiles\Git\bin\git.exe for windows

Similarly we can set JDK path as well as


Now Suppose you have git project on github and you have installed git in your local system now you want to clone your project from github to local then what you have to do 

1) Create a folder in your local machine.
now go to this particular folder and run cmd from that particular location and run a command like 

C:\gitpull>git clone url_of_project_from_github (this is manula task but we can automate this compile and build and run by creating a jobs in jenkins)

so we have to create a job for that.


Part 6 - Creating Freestyle project using Jenkins 2.0

Now Create New Jobs -> Select Freestyle Project

General : Define Project Name and Description 

Source Code Management : Like Setup Git, Subversion (These are for getting source code of project from following source and then compiling )

Build Trigger : 

Build : this is for to build the download project by using like maven (if we select the maven then we have to define the following properties like Goals - compile, test, clean, package ) then we have to define POM file if its on different file structure otherwise its ok.


Build Environment 


After this if we want to build this project then we have to use "Build Now" option form left side of dashboard.

If something failed then we can see at "console output " 

Part 7  - Creating Freestyle Project using Jenkins 2.0 for Build + Test
In this tutorial we are going to integrate testing as well as. 

Part 8 - Creating Pipeline Project Using Jenkins 2.0 for Build + Test + Reporting

Pipeline is the future of Jenkins 2.0

Jenkinfile is written using groovy.

For this we have to choose project rather then Freestyle Project to "Pipeline Project" 


While choose we have to define Pipeline commands for that i have to use different Pipline command that can be generated by build in option provide by jenkins we can auto generate the syntax.

1) first we have to define svn/git pipline command. 
2) We have to define maven command first we have to select General Build Step > (If we don't see then we can define batch script command for windows similarly for ubuntu or linux. like : mvn compile then generate pipline command )

After this if you build and get an error like 



Perhaps you forgot to surround the code with a step that provides this, such as :node



we have to create a node in pipeline and that node we have to put our git ,svn ,mvn , commands.



Note : As we can see we have Build Executor basically if we click on Build Eecutor we can see we have a master build executor. which is having 2 executors here. this master is called as Node. which basically inside your master machine. If you have many no of nodes. you can just configure them as different nodes. to perform different executors/execution. We can also crate a new node/different node and can scale out these nodes setting in  different machine  


Part 9 - Creating Pipeline project using Jenkins 2.0 for Build + Test + Reporting 
for reporting we can integrate cucumber reports plugin in jenkins.


Part 10 - Creating stages in Pipeline project using Jenkins 2.0

are very help to view the progress of every steps happing in pipeline.

we can do it by adding following line of code in pipeline



Part 15 : Configuring Email Notification with Jenkins 2.0

till now we have created freestyle project /pipeline project and build+testing + reporting project 

But we have missed most important notification part of team every-time build is completed. 

we are going to setup own smtp server for email sending.
we are going to use docker container based MailDev client.


Part 17 Build trigger with Jenkins 

Build trigger in Jenkins let us to start a job once any specified event occurs.

Part 18 Configure agents in Jenkins 2.0

Jenkins supports the "master/slave" mode where the workload of building projects are delegated to multiple "slave" nodes allowing a single jenkins installation to host a large number of projects or to provide different environments needed for builds/tests.

Different ways starting slave agent.

there are different ways starting a slave agents like

1) Have master launch slave agent via ssh
2) Have master launch slave agent on windows
3) Write your own script to launch Jenkins slaves
4) Launch slave agent visa java web start
5) Launch slave agent headlessly


Part 19 : Blue Ocean and UI/UX improvements in jenkins








Comments

  1. Thanks to share such a great article on software testing, developing. I will be glad to share this blog with my friends, those who are making a Best Construction Project Management Software. This blog will be helpful to them for software project.

    ReplyDelete
  2. Really a great post. Appreciate the effort in educating us. We are also same service provides in Noida.

    SEO Company Noida
    SEO Services Noida
    SEO Services India

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. it is great post software solutions is a custom software development and IT-Services. We can provide consulting and software testing. Kuncham company is offering speciality Corporate TrainingSoftware Development

    ReplyDelete
  5. I was a little bit impressed, when I have learnt, that JavaScript is used in this server. I believe, that this information will be valuable for people, who are working in a sphere of programming.

    ReplyDelete

Post a Comment

Popular posts from this blog

How do I change the time zone of my Amazon RDS database instance?

As we know bydefault time in the format of UTC in mysql.We can set local time zone to our AWS RDS Instance for our application. or any other time zone prefared Cloud Based Website Hosting Service Provider Steps 1: Go to Services and Select RDS Now to change time zone we have to change "Parameter Group" in left side that is associated with DB instance first we can check default Parameter Group for our instance is Parameter group default.mysql5.7  ( in-sync ) like this. So we have to change the time zone in this Parameter Group.  now open that parameter group (default.mysql5.7)  and click on edit parameter. then search for time_zone (because we want to change it.) then we have to change time_zone only by default it is engine-default (that is utc)  we have to select Asia/Calcutta.  More information we can ref.  https://aws.amazon.com/premiumsupport/knowledge-center/rds-change-time-zone/

Changing the Time Zone on Amazon Linux Ec2 Instance

Amazon Linux instances are set to the UTC (Coordinated Universal Time) time zone by default, but you may wish to change the time on an instance to the local time or to another time zone in your network. Important These procedures are intended for use with Amazon Linux. For more information about other distributions, see their specific documentation. To change the time zone on an instance Identify the time zone to use on the instance. The  /usr/share/zoneinfo  directory contains a hierarchy of time zone data files. Browse the directory structure at that location to find a file for your time zone. [ec2-user ~]$ ls /usr/share/zoneinfo Africa Chile GB Indian Mideast posixrules US America CST6CDT GB-Eire Iran MST PRC UTC Antarctica Cuba GMT iso3166.tab MST7MDT PST8PDT WET Arctic EET GMT0 Israel Navajo right W-SU ... Some of the entries at this location are directo

Digital Marketing

What actually is Digital Marketing? This post will help you understand the insights of Digital Marketing What is Digital Marketing? Digital Marketing is an integral part of the overall marketing strategies of any business. It basically covers the advertisement of products/services/business/brand via digital channels. The digital channels could be of any type like websites, search engines, social media, emails, SMS, and MMS. In case if you're using all these digital channels for the marketing, make sure to have all the statistics & workflow of your campaigns via marketing automation. What are the types of digital marketing? Well, there are 6 core digital marketing types: Search Engine Optimization (SEO) : Search Engine Optimization is nothing but a long-term process of improving your website rankings on search engine results pages (SERPs), which in turn has a wide range of tactics & strategies to implement. Although there is no specific method or a  spec