0% found this document useful (0 votes)
31 views6 pages

Jenkins End To End

Jenkins is an open-source automation server that facilitates continuous integration and delivery in software development, supporting various version control tools and build systems. It allows for automated builds and testing, with functionalities that can be extended through plugins. The document also covers installation instructions, job configuration, email notifications, and deployment strategies for Jenkins on both Windows and Ubuntu systems.

Uploaded by

RushendraKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views6 pages

Jenkins End To End

Jenkins is an open-source automation server that facilitates continuous integration and delivery in software development, supporting various version control tools and build systems. It allows for automated builds and testing, with functionalities that can be extended through plugins. The document also covers installation instructions, job configuration, email notifications, and deployment strategies for Jenkins on both Windows and Ubuntu systems.

Uploaded by

RushendraKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

NRUSHIKESH

9448431435
[email protected]

JENKINS

Jenkins is a free and open source automation server. Jenkins helps to automate the non-human part of the software development process, with continuous
integration and facilitating technical aspects of continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat. It
supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, TD/OMS, ClearCase and RTC, and can execute Apache Ant, Apache
Maven and sbt based projects as well as arbitrary shell scripts and Windows batch commands. The creator of Jenkins is Kohsuke Kawaguchi.[4] Released under
the MIT License, Jenkins is free software.[5]
Builds can be triggered by various means, for example by commit in a version control system, by scheduling via a cron-like mechanism and by requesting a
specific build URL. It can also be triggered after the other builds in the queue have completed. Jenkins functionality can be extended with plugins.
The Jenkins project was originally named Hudson, and was renamed after a dispute with Oracle, which had forked the project and claimed rights to the project
name. The Oracle fork, Hudson, continued to be developed for a time before being donated to the Eclipse Foundation. Oracle's Hudson is no longer maintained[6]
[7] and was announced as obsolete in February 2017. [8]

Installation jenkins on n

What is jenkins ? (Hudson)


-->CI/CD Tool
-->presently jenkins owned by oracle
-->Plugin Based Tool
-->Configurations Easy

Before CI-CD /After CI-CD

What is Automation ?

Pre-Requisites of jenkins
Java

Method1:
Jenkins Download in windows
Google: jenkins download
Link : https://jenkins.io/download/
Path: C:\Program Files (x86)\Jenkins
DefaultPort: localhost:8080

Which version are you using in your organization?


2+

Changing Jenkins Port Number


C:\Program Files (x86)\Jenkins\jenkins.xml

Find below lines and change under httpPort


-->
<executable>%BASE%\jre\bin\java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --
webroot="%BASE%\war"</arguments>
<!--

Restart Jenkins once u make any changes


localhost:8080/restart

Creating new user in jenkins


Manage jenkins --> Mange users -->

Reset Jenkins Credentials?


Manage jenkins --> Manage Users-->settings-->Password (change password here)

JENKINS:

CI/CD Part
NRUSHIKESH
9448431435
[email protected]

Continuous integration
Developers practicing continuous integration merge their changes back to the main branch as often as possible. The developer's changes
are validated by creating a build and running automated tests against the build. By doing so, you avoid the integration hell that usually
happens when people wait for release day to merge their changes into the release branch.

Continuous integration puts a great emphasis on testing automation to check that the application is not broken whenever new commits
are integrated into the main branch.

Continuous delivery
Continuous delivery is an extension of continuous integration to make sure that you can release new changes to your customers quickly
in a sustainable way. This means that on top of having automated your testing, you also have automated your release process and you
can deploy your application at any point of time by clicking on a button.

In theory, with continuous delivery, you can decide to release daily, weekly, fortnightly, or whatever suits your business requirements.
However, if you truly want to get the benefits of continuous delivery, you should deploy to production as early as possible to make sure
that you release small batches that are easy to troubleshoot in case of a problem.

Continuous deployment
Continuous deployment goes one step further than continuous delivery. With this practice, every change that passes all stages of your
production pipeline is released to your customers. There's no human intervention, and only a failed test will prevent a new change to be
deployed to production.

Continuous deployment is an excellent way to accelerate the feedback loop with your customers and take pressure off the team as there
isn't a Release Day anymore. Developers can focus on building software, and they see their work go live minutes after they've finished
working on it.

Installation Jenkins on ubuntu 18.04:

Step1:launch one ubuntu server

Step2:Install jenkins on ubunu 18.04

Pre-req :java

Install java:

sudo apt-get install default-jdk

Install maven:

sudo apt-get install maven

Install git

sudo apt-get install git

https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-18-04

Jenkins commands Description


sudo systemctl start jenkins start jenkins
sudo systemctl stop jenkins stop jenkins
sudo systemctl restart jenkins restart jenkins
sudo systemctl status jenkins status jenkins

jenkins port number 8080


Tomcat Port Number 8080
NRUSHIKESH
9448431435
[email protected]
Jenkins Port Number

Changing Port Number in jenkins

sudo vi /etc/default/jenkins

GLOBAL TOOL CONFIGURATON:

CREATING AND CONFIGURING A JOB:


Create a new job

General :
>Discard old builds - deleting old builds

>(No.of jobs will build parallel


No .of builds are not parallel)

>Execute concurrent builds if necessary(now builds are parallel)

Source code Management:


>Provide github url- credentials -branch

Build Triggers:
>Trigger builds remotely (e.g., from scripts)
Authentication Token = Rushi123

Sampletoken : JENKINS_URL/job/job10/build?token=TOKEN_NAME
http://localhost:9090/job/job10/build?token=Rushi123
NRUSHIKESH
9448431435
[email protected]
Build after other projects are built:
Dependency jobs:create a multiple jobs and configure dependency jobs

Build Peridocally:

day

O and 7 are Sunday


1 monday

*/30 * * * * Every 30 seconds


***** - Every minute
*/2 * * * * Every 2 minutes
0 */2 * * * Every 2 hours
30 */2 * * * 2 hour 30 minutes
0 0 * * MON Every Monday
07**1 Every Monday 7

PollSCM:
*****

Webhooks:

Build Environment

--> Delete workspace before build starts


-->Abort the build if it's stuck
After particular period it kills the job if it strucks
-->Add timestamps to the Console Output

Build
--> Execute windows batch command
( for executing windows commands)

--> Execute shell


(execution for linux commands)
sudo cp -rf /var/lib/jenkins/workspace/WorkOrder/* /var/www/html/WorkOrder/

--> Invoke Top-Level Maven Targets


clean install

-->Execute windows batch command


COPY “C:\Program Files (x86)\Jenkins\workspace\helloworld\targetWebapps.war” “D:\Rushi-prep\Tomcat\apache-tomcat-7.0.94\webapps”

Post Build
NRUSHIKESH
9448431435
[email protected]

Email Notification

MangeJenkins--> Configuration --> Email Notification

Outlook
SMTP server - smtp.outlook365.com
suffix - @accenture.com

click on smtp Authentication


From which mail

click ssl
gmail SMTP port - 587

Test configuration :our mail id

enable email security


click on email -my account -sign in security (sign in to google)
go to last -allow less security apps :on

_______________________-

15) Email Notification setup: ( if job is fail)


*first have to configure smtp -server
*manage jenkins - configuresystems - email notification (smtp -dns name or ipaddress)

16)For build success - Editable email notification

manage jenkins - config sys - extended Email notification


Smtp - smtp.gmail.com
suffix - @gmail.com
use smtp
user name - mail & Pw
use ssl
smtp Port - 465

Now provide mail id in -post build action - editable email notification

project recipst list -email, email


Default subjec --hello jenkins
attach build log -
Advance settings -add trigger - always -save

Deploying war file in cloud server:


NRUSHIKESH
9448431435
[email protected]

Plugins Used:

Myview
Deploy to container
Role based Authorization stratergy
Discard old builds
Webhooks
Add timestamps to the Console Output
Deploy to container
Email notification
Editable Email notification

You might also like