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

Post a Comment

Popular posts from this blog

Android & iOS Application Development For Dummies

App Development ProcessApp Development Process explained in the most simplified way This tutorial will guide all the beginners how an app is developed from scratch and will help in letting the beginners know how the process works.Phase-1 (Conceptualization): Even a concept or an idea starts with an approach to introduce something after acknowledging the inkling of amiss or what's missing in the existing market. Developing the aftermath ideas involves critical questioning and rational thinking towards the wire-framing stage. Phase-2 (Design): After analyzing the idea thoroughly and looking through all possible dimensions, comes the design part, where a feasible layout of the model is planned to move ahead for the further development processes. Phase-3 (Coding): Development process begins with designing a user-friendly UI. Prototypes of the model are prepared with the combined agreement of developers and designers to increase the efficiency and capitalization. The expedience checking r…

Amazon EC2 Server Setup & Installing JDK 8 and Tomcat 8, Running on Port 80 & 443 and Redirect Request from port 80 to 8080 and 443 to 8443

Amazon EC2 Server Setup & Installing JDK 8 and Tomcat 8, Running on Port 80 & 443 and Redirect Request from port 80 to 8080 and 443 to 8443.Step 1 : Log in to youraws account by following this link then click on my account and choose option aws management console.
Note: I am assuming you created your account with aws and you are ready with you account if you haven’t done then you can check out on google you will get many and it's a straight forward steps if you have still problem while creating an account you can comment in comment box i will also provide tutorial for that.
Once you logged in aws management console you are able to see window like this one


Note : Before we go ahead we have to select proper reason from right and side.I choose ohio region for this example.
Step 2 : Now you have to choose EC2 Server from Services tab on left side top corner then choose EC2 Services from “Compute option”

You will get window like this one and right now i have one instance is running for…

Digital Marketing

What actually is Digital Marketing?
This post will help you understand the insights of Digital MarketingWhat 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  specific formula with which an …