
Notes:
Jenkins
- java application
- used for continuous integration and continuous delivery
Step 1 : Download Jenkins war file - https://jenkins.io/
Step 2 : Place the war file into any location on your system
Step 3 : goto command prompt (windows) | terminal (mac)
- goto folder where jenkins.war is
- java -jar jenkins.war
Step 4 : goto browser - http://localhost:8080 (Jenkins window should show up)
Step 5 : install required plugins
Step 6 : get started with Jenkins
____________________________________________________________
To see hidden files/folders on mac:
1. Exit Finder
2. On terminal - defaults write com.apple.finder AppleShowAllFiles TRUE
3. Press option/alt - right click finder - relaunch
Notes:
Jenkins Home Directory contains:
1. All configurations
2. Plugins
3. Jobs details
4. Logs
Why:
-To move jenkins home dir to a location that has enough disk space
-Project requirements
If you have installed jenkins on windows through msi file then read this - http://tech.nitoyon.com/en/blog/2014/02/25/jenkins-home-win/
Step 1 : Check your current home directory
Step 2 : Create a new folder (which will be new home dir)
Step 3 : Copy all data from old dir to new dir
Step 4 : change env variable - JENKINS_HOME and set to new dir
Windows - change env variable
Mac - goto terminaal
export JENKINS_HOME=/Users/raghav/Desktop/Tools/Jenkins/JenkinsHome/
Step 5 : restart Jenkins
____________________________________________________________
To see hidden files/folders on mac:
1. Exit Finder
2. On terminal - defaults write com.apple.finder AppleShowAllFiles TRUE
3. Press option/alt - right click finder - relaunch
Step 1 : start Jenkins
Step 2 : goto Manage Jenkins - Configure Global Security - enable security
Step 3 : goto - http://localhost:8080/cli/
Step 4 : download jerkins-cli jar. Place at any location.
Step 5 : test the jenkins command line is working
Notes:
Jenkins authentication and authorization
Today we will learn:
How to create New Users
How to configure users
How to create new roles
How to assign users to roles
How to Control user access on projects
Step 1 : Create new users
Step 2 : Configure users
Step 3 : Create and manage user roles Roles Strategy Plugin - download - restart jenkins
Step 4 : Manage Jenkins - Configure Global Security - Authorisation - Role Based Strategy
Step 5 : Create Roles and Assign roles to users
Step 6 : Validate authorization and authentication are working properly
Notes:
Step 1 : Goto Manage Jenkins - Configure System
Step 2 : Get a basic understanding of common/basic configurations
Notes:
Today we will learn:
1. How to create a basic JOB in Jenkins
2. Basic job configurations
2. How to run the Job remotely
4. How to chain Job Execution
Step 1 : Jenkins - New Item - add details
Step 2 : How to trigger the job remotely
Step 3 : How to chain job executions
Notes:
Today we will learn
1. Create a java program and run it through command line
2. Create a Jenkins job to run the java program
3. Add this program/project to Git
4. Jenkins - add git plugin
5. Configure Jenkins job to trigger the execution when a change is pushed to GitHub
__________________________________________________________
Step 1 : Create a java program
Step 2 : Compile from command line
javac “name of .java class”
java “name of class without extension .java”
Step 3 : Create a Jenkins job to run this program
Step 4 : Add the project to Git and GitHub
For Reference:
----------------------
Git and GitHub Beginner Tutorial 1 - Introduction - https://youtu.be/-U-eUHI6euM?list=PLhW3qG5bs-L8OlICbNX9u4MZ3rAt5c5GG
Git and GitHub Beginner Tutorial 2 - Getting started - Install Git (mac) - https://youtu.be/0Icla6TVNNo?list=PLhW3qG5bs-L8OlICbNX9u4MZ3rAt5c5GG
Git and GitHub Beginner Tutorial 3 - Getting started - Install Git windows - https://youtu.be/sBTAkHOxvOk?list=PLhW3qG5bs-L8OlICbNX9u4MZ3rAt5c5GG
Step 5 : Configure Jenkins job to trigger build on Git commit
___________________________________________________________
Notes:
Today we will learn :
What is Automated Deployment ?
Main stages in
Continuous delivery and deployment pipeline
1. BUILD
2. DEPLOY
3. TEST
4. RELEASE
Lets see ...
A real world Project SetUp
Automated Deployment is the process of Automating the deployment process in a Continuous Delivery system
Build - Deploy - Test - Release
Notes:
Today we will learn :
How to do Automated Deployments with Jenkins ?
Step 1
Start Jenkins
Step 2
Install Plugin
(Deploy Plugin)
https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin
You can also goto your Jenkins on browser and
- Manage Jenkins - Plugins Manager - Click on Available tab and search for deploy to container
Add to Jenkins
Step 3
Create a Build JOB in Jenkins
Step 4
Add Post-build Action Deploy war/ear to container
(add values to the fields)
sample war file - https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/
Step 5
In tomcat-users.xml add user for DEPLOYMENT
user username="deployer" password="deployer" roles="manager-script" /
Step 6
Run and Validate
What is Automated Deployment
https://www.youtube.com/watch?v=HkLXbFDlMtU
How to install and setup TOMCAT
https://www.youtube.com/playlist?list=PLhW3qG5bs-L9MQ02hBtHVlfrf0TThsZqB
Notes:
Today we will learn about Jenkins Notifications
Manage Jenkins - Configure System - Email Notifications
To find your smtp server and port details
https://www.arclab.com/en/kb/email/list-of-smtp-and-pop3-servers-mailserver-list.html
..
References:
Notification Plugins
https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Extreme+Notification+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin
Notes:
Today we will learn:
What is Pipeline in Jenkins ?
Pipeline - is a workflow with group of events or jobs that are chained and integrated with each other in sequence.
Every job in a pipeline has some dependency on one or more other jobs
Let us understand...
in an easy way !
(Watch the representations in the video)
References -
https://tex.stackexchange.com/questions/196680/how-can-i-draw-this-reservoir-diagram-with-tikz
https://readtiger.com/wkp/en/Pump
Notes:
Today we will learn :
How to setup Delivery Pipeline in Jenkins ?
Follow along step by step
Step 1
Chain required jobs in sequence
Add upstream/downstream jobs
Step 2
Install
Delivery Pipeline Plugin
Step 3
Add
Delivery Pipeline View
configure the view
Step 4
Run and Validate
Notes:
Today we will learn :
How to setup BUILD PIPELINE in Jenkins ?
Follow along step by step
Step 1
Chain required jobs in sequence
Add upstream/downstream jobs
How to chain jobs? Watch
https://www.youtube.com/watch?v=ndLbn24OwQg
Step 2
Install
Build Pipeline Plugin
Step 3
Add
Build Pipeline View
configure the view
Step 4
Run and Validate
____________________________________________________________
Difference between Build and Delivery Pipeline:
At a high level you can say Build pipeline has a smaller scope in terms of the entire process of software dev and delivery whereas delivery pipeline has a much broader scope. Also when we say delivery, build pipeline will be one of its components.
Build Pipeline provides a view of the upstream and downstream jobs setup for the build process (typically)
Whereas Delivery Pipeline gives the visualization of the complete Delivery Process that may include Build, Deploy, Test. In the delivery pipeline view, you can see each of these sections in a separate box.
Just have a look here:
Build Pipeline - https://wiki.jenkins.io/display/JENKINS/Build+Pipeline+Plugin
Delivery Pipeline - https://wiki.jenkins.io/display/JENKINS/Delivery+Pipeline+Plugin
Step 1 : Start Jenkins
Step 2 : Create a new freestyle job
Step 3 : Parametrize job
Step 4 : Run and validate
syntax
Windows - %parametername%
*nux/mac - $parametername
${parametername}
"${parametername}"
Today we will learn:
1. How to run a job from command line
2. How to run a job from command line with user authentication
(with username and password)
3. How to show progress/results on command line
_________________________________________________
Today we will learn:
1. How to run job with parameters from command line
2. How to show result on command line
Today we will learn
How to add different type of parameters in jenkins job
Run and validate
References:
How to Parameterize Job - https://www.youtube.com/watch?v=hgqBGNPlLlU
Extended Choice Parameter Plugin
https://wiki.jenkins.io/display/JENKINS/Extended+Choice+Parameter+plugin
JENKINS
How to pass Parameters to Downstream job
Parameterized Trigger Plugin
Today we will learn:
How to pass values to parameters from one job to another job
Step 1 : Start Jenkins
Step 2 : Manage Jenkins > Manage Plugins
Step 3 : Create a parametrised job
Step 4 : Create a new upstream job
Step 5 : In Post Build Actions -
Select - Trigger parameterised build on other projects
Pass the parameters
References:
https://wiki.jenkins.io/display/JENKINS/Parameterized+Trigger+Plugin
https://www.youtube.com/playlist?list=PLhW3qG5bs-L8T-0JT464rkIvnUz5q4CQC
JENKINS : Build Monitor View
Today we will learn:
What is Build Monitor View plugin
How to add in Jenkins
References:
https://wiki.jenkins.io/display/JENKINS/Build+Monitor+Plugin
Notes:
Why?
Running Jenkins standalone (jetty/winstone) vs Running Jenkins on Tomcat
Pre-requisite
***Tomcat 5 or above***
***java(7 or above) should be available***
(https://www.youtube.com/watch?v=FqpmH8MVO6A&list=PLhW3qG5bs-L_qj1L5hnHvJYeFpQ_g4UuU)
Step 1 : Download Tomcat
Step 2 : Unzip and place tomcat folder at any location
Step 3 : Copy/Place the jenkins.war file inside tomcat/webapps folder
Step 4 : Goto commandpromt (cmd) - windows | terminal - mac
- goto tomcat/bin directory
- make all files executable : chmod +x *.sh
In case of windows this command will not work. This step might not be needed if you are on windows. Else you can right click on the file/folder goto security tab and change the permissions.
Can watch -
TOMCAT - How to install and run on Windows | Change Port | Run app
https://youtu.be/ZIIkrn6LHW0?list=PLhW3qG5bs-L9MQ02hBtHVlfrf0TThsZqB
Step 5 : Start Tomcat : ./startup.sh
(to shutdown tomcat : ./shutdown.sh)
Step 6 : verify if tomcat started : browser - http://localhost:8080
Step 7 : verify if jenkins is running on tomcat : http://localhost:8080/jenkins
*** To start jenkins (standalone) on a diff port***
java -jar jenkins.war - - httpPort=9090
Jenkins is a Automation and CI Tool. It is a java application and very easy to learn.
This course is designed for complete Beginners to understand and learn Jenkins from scratch.
We will go very basic step by step in this course and by the end you will be able to use Jenkins at all levels.
Let's Get Started