SlideShare a Scribd company logo
Jenkins 101: Getting Started
By
R. Geoffrey Avery
FOSSCON – Philadelphia 2016
YAPC::EU – Cluj 2016
What is Jenkins
● Tool for continuous integration/development
● A fork from Hudson
● Fire jobs manually, on a schedule, on commit
● Uses Java and Tomcat to do its work
● In same game as TravisCI
Install Jenkins
sudo wget -q -O - https://jenkins-ci.org/debian/jenkins-
ci.org.key | apt-key add -
sudo apt-get install jenkins
#------
sudo wget -O /etc/yum.repos.d/jenkins.repo
http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-
ci.org.key
sudo yum install jenkins
● https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins
A new Jenkins
Manage Jenkins
Configure Node
● If you are on a small server Nerf these or
provide more resources
Manage Jenkins
How to add users
● https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup
● Make sure your user has powers before you deny everyone full power
Get to adding users
● Manage Jenkins → Configure Global Security
Enable Security
● Turn on security
● Let Jenkins manage
● Anyone can still get in
(don't lock yourself
out)
Become a User
● Go create yourself a user
Enable Matrix Security
● Pick matrix
● Add yourself
● Give yourself full power
Plugins
● Jenkins supports many plugins to add features
● Can generally install new plugin without a
restart
● To upgrade or remove a restart usually needed
HTML Publisher Plugin
● https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin
Add Plugin
Approve the plugin
More good plugins
https://wiki.jenkins-ci.org/display/JENKINS/
● NodeLabel+Parameter+Plugin
● Validating+String+Parameter+Plugin
● Git+Plugin (need git 1.7.9+)
Create a Job
Job to grep configurations
● Jenkins stores job as
…/jobs/jobname/config.xml
● Pain to search across many jobs
● This sample job will grep just config.xml files
● Will make html report of what is found
Live Demo Now
Schedule for Periodic Builds
This field follows the syntax of cron (with minor differences). Specifically, each line consists of 5
fields separated by TAB or whitespace:
MINUTE HOUR DOM MONTH DOW
MINUTE Minutes within the hour (0–59)
HOUR The hour of the day (0–23)
DOM The day of the month (1–31)
MONTH The month (1–12)
DOW The day of the week (0–7) where 0 and 7 are Sunday.
To specify multiple values for one field, the following operators are available. In the order of
precedence,
* specifies all valid values
M-N specifies a range of values
M-N/X or */X steps by intervals of X through the specified range or whole valid range
A,B,...,Z enumerates multiple values
To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”)
should be used wherever possible. For example, using 0 0 * * * for a dozen daily jobs will cause a
large spike at midnight. In contrast, using H H * * * would still execute each job once a day, but not
all at the same time, better using limited resources.
The H symbol can be used with a range. For example, H H(0-7) * * * means some time between 12:00 AM
(midnight) to 7:59 AM. You can also use step intervals with H, with or without ranges.
The H symbol can be thought of as a random value over a range, but it actually is a hash of the job
name, not a random function, so that the value remains stable for any given project.
Schedule for School Night
H H(6-11) * * 1-5
#Once each school night between 10pm-4am San Francisco /
1am-7am Wilmington / 6am-noon London (an hour later in
summer)
#If someone does something foolish on Friday or Saturday the
site won't be broken over the weekend because of the update
● Schedule jobs with a very cron like syntax
● Use 'H' to let jenkins pick for better distribution
Return to live demo
Add a slave node
● Not all work needs to or should run on master
● Slaves can be on same server or many
● Make a user (groupadd, useradd)
● Install Java (apt-get, yum, or ?)
● Setup ssh for connections...
Create ssh key for slave
jenkins@localhost:~$ mkdir .ssh
jenkins@localhost:~$ cd .ssh
jenkins@localhost:~/.ssh$ chmod 0700 .
jenkins@localhost:~/.ssh$ ssh-keygen -C "jenkins to slave mrprod"
-f jenkins_to_mrprod
jenkins@localhost:~/.ssh$ ls -aFl
total 16
drwx------ 2 jenkins jenkins 4096 Jun 1 12:53 ./
drwxr-xr-x 14 jenkins jenkins 4096 Jun 1 12:51 ../
-rw------- 1 jenkins jenkins 1679 Jun 1 12:53 jenkins_to_mrprod
-rw-r--r-- 1 jenkins jenkins 399 Jun 1 jenkins_to_mrprod.pub
.ssh/config
host sample-mrprod
hostname sample.dynalias.org
user mrprod
identityfile ~/.ssh/jenkins_to_mrprod
● Let the master call slave from command line
● Will need ForwardAgent and Proxy Command if
you need to tunnel through a middle box
Give ssh key to slave
root@localhost:/home/mrprod# sudo su mrprod
localhost:~> pwd
/home/mrprod
localhost:~> mkdir .ssh
localhost:~> chmod 0700 .ssh
localhost:~> cd .ssh
localhost:~/.ssh> touch authorized_keys
localhost:~/.ssh> chmod 0600 authorized_keys
#then put the public key in authorized_keys
● ssh will not work if you forget the chmod step
Add ssh key to jenkins
Add ssh key to jenkins (2)
Create a slave node
Make a label for nodes
Live Demo Now
Starting and Stopping
http://sample.dynalias.org:8080/quietDown
http://sample.dynalias.org:8080/cancelQuietDown
${JENKINSURL}/${ACTION}
#------
$ sudo /etc/init.d/jenkins restart
● Other valid choices for the ACTION: start|stop|status|restart|
force-reload
● A good idea to quietDown first so you don't stop jobs in progress
Thank You
Slides will be found at
http://platypiventures.com/perl/present
And the conference website
Slides of the Rigged Demo
These were replaced by the live demo
Job Name
Basic Job Settings
Add a Variable
What do you want to look for?
Pass through to grep
Advanced Job Settings
Source Code Settings
● Git needs a plugin
Add Code to Do Something
● Add a shell to do the real work. Today with bash, but
also supports Groovy and anything you can call
Script Part 1
#!/bin/bash
# make sure we have place to write the output
# if no directory build one, blow away a file it it is in the way
if [[ ! -d $WORKSPACE/output ]] ; then
if [[ -e $WORKSPACE/output ]] ; then
rm $WORKSPACE/output
fi
mkdir $WORKSPACE/output
fi
ls -aFlR $WORKSPACE
report="$WORKSPACE/output/found.html"
hostname
whoami
pwd
cd ../../jobs
pwd
echo "<h1>$Pattern</h1> ( $Settings )<hr>" > $report
Script Part 2
jenkinsgrep () {
for dir in * ; do
echo "nn--------------- $dir"
local results=$(grep $Settings $Pattern $dir/config.xml)
if [[ -n $results ]]; then
echo $results
# echo "<h2>$dir</h2>" >> $report
echo "<h2><a href='${JENKINS_URL}job/$dir/configure'>$dir</a></h2>" >> $report
echo "<pre>$results</pre>" >> $report
fi
done
}
jenkinsgrep
Add an HTML report
Configure the Report
The End (Again)
Check github for slides and the config.xml files for
the jobs discussed

More Related Content

What's hot

Jenkins
JenkinsJenkins
Jenkins
Roger Xia
 
Jenkins
JenkinsJenkins
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
Jonathan Holloway
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
Viyaan Jhiingade
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
Martin Málek
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
Dan MAGIER
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
Phuc Nguyen
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
Gong Haibing
 
Bitbucket
BitbucketBitbucket
Bitbucket
Okba Mahdjoub
 
GitLab for CI/CD process
GitLab for CI/CD processGitLab for CI/CD process
GitLab for CI/CD process
HYS Enterprise
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
CICD with Jenkins
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
MoogleLabs default
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with Jenkins
Edureka!
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
JEMLI Fathi
 
Jenkins
JenkinsJenkins
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
Edureka!
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
Dragos Balan
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Frederik Mogensen
 

What's hot (20)

Jenkins
JenkinsJenkins
Jenkins
 
Jenkins
JenkinsJenkins
Jenkins
 
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
GitLab for CI/CD process
GitLab for CI/CD processGitLab for CI/CD process
GitLab for CI/CD process
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
CICD with Jenkins
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
 
CICD with Jenkins
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
 
Getting started with Jenkins
Getting started with JenkinsGetting started with Jenkins
Getting started with Jenkins
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
 
Jenkins
JenkinsJenkins
Jenkins
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 

Similar to Jenkins 101: Getting Started

Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
Glen Ogilvie
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
Sylvain Rayé
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
NETWAYS
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
Puppet
 
Moving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventuresMoving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventures
Frits Van Der Holst
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
Mohamad Hassan
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
Cédric Delgehier
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
Francesco Pantano
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
Steffen Gebert
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
John Congdon
 
NginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniquesNginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniques
Claudio Borges
 
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
Docker, Inc.
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
David Benjamin
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
Kim Chee Leong
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
bpowell29a
 

Similar to Jenkins 101: Getting Started (20)

Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
Moving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventuresMoving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventures
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
NginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniquesNginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniques
 
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 

Recently uploaded

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

Jenkins 101: Getting Started

  • 1. Jenkins 101: Getting Started By R. Geoffrey Avery FOSSCON – Philadelphia 2016 YAPC::EU – Cluj 2016
  • 2. What is Jenkins ● Tool for continuous integration/development ● A fork from Hudson ● Fire jobs manually, on a schedule, on commit ● Uses Java and Tomcat to do its work ● In same game as TravisCI
  • 3. Install Jenkins sudo wget -q -O - https://jenkins-ci.org/debian/jenkins- ci.org.key | apt-key add - sudo apt-get install jenkins #------ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo sudo rpm --import https://jenkins-ci.org/redhat/jenkins- ci.org.key sudo yum install jenkins ● https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins
  • 6. Configure Node ● If you are on a small server Nerf these or provide more resources
  • 8. How to add users ● https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup ● Make sure your user has powers before you deny everyone full power
  • 9. Get to adding users ● Manage Jenkins → Configure Global Security
  • 10. Enable Security ● Turn on security ● Let Jenkins manage ● Anyone can still get in (don't lock yourself out)
  • 11. Become a User ● Go create yourself a user
  • 12. Enable Matrix Security ● Pick matrix ● Add yourself ● Give yourself full power
  • 13. Plugins ● Jenkins supports many plugins to add features ● Can generally install new plugin without a restart ● To upgrade or remove a restart usually needed
  • 14. HTML Publisher Plugin ● https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin
  • 17. More good plugins https://wiki.jenkins-ci.org/display/JENKINS/ ● NodeLabel+Parameter+Plugin ● Validating+String+Parameter+Plugin ● Git+Plugin (need git 1.7.9+)
  • 19. Job to grep configurations ● Jenkins stores job as …/jobs/jobname/config.xml ● Pain to search across many jobs ● This sample job will grep just config.xml files ● Will make html report of what is found
  • 21. Schedule for Periodic Builds This field follows the syntax of cron (with minor differences). Specifically, each line consists of 5 fields separated by TAB or whitespace: MINUTE HOUR DOM MONTH DOW MINUTE Minutes within the hour (0–59) HOUR The hour of the day (0–23) DOM The day of the month (1–31) MONTH The month (1–12) DOW The day of the week (0–7) where 0 and 7 are Sunday. To specify multiple values for one field, the following operators are available. In the order of precedence, * specifies all valid values M-N specifies a range of values M-N/X or */X steps by intervals of X through the specified range or whole valid range A,B,...,Z enumerates multiple values To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible. For example, using 0 0 * * * for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H * * * would still execute each job once a day, but not all at the same time, better using limited resources. The H symbol can be used with a range. For example, H H(0-7) * * * means some time between 12:00 AM (midnight) to 7:59 AM. You can also use step intervals with H, with or without ranges. The H symbol can be thought of as a random value over a range, but it actually is a hash of the job name, not a random function, so that the value remains stable for any given project.
  • 22. Schedule for School Night H H(6-11) * * 1-5 #Once each school night between 10pm-4am San Francisco / 1am-7am Wilmington / 6am-noon London (an hour later in summer) #If someone does something foolish on Friday or Saturday the site won't be broken over the weekend because of the update ● Schedule jobs with a very cron like syntax ● Use 'H' to let jenkins pick for better distribution
  • 24. Add a slave node ● Not all work needs to or should run on master ● Slaves can be on same server or many ● Make a user (groupadd, useradd) ● Install Java (apt-get, yum, or ?) ● Setup ssh for connections...
  • 25. Create ssh key for slave jenkins@localhost:~$ mkdir .ssh jenkins@localhost:~$ cd .ssh jenkins@localhost:~/.ssh$ chmod 0700 . jenkins@localhost:~/.ssh$ ssh-keygen -C "jenkins to slave mrprod" -f jenkins_to_mrprod jenkins@localhost:~/.ssh$ ls -aFl total 16 drwx------ 2 jenkins jenkins 4096 Jun 1 12:53 ./ drwxr-xr-x 14 jenkins jenkins 4096 Jun 1 12:51 ../ -rw------- 1 jenkins jenkins 1679 Jun 1 12:53 jenkins_to_mrprod -rw-r--r-- 1 jenkins jenkins 399 Jun 1 jenkins_to_mrprod.pub
  • 26. .ssh/config host sample-mrprod hostname sample.dynalias.org user mrprod identityfile ~/.ssh/jenkins_to_mrprod ● Let the master call slave from command line ● Will need ForwardAgent and Proxy Command if you need to tunnel through a middle box
  • 27. Give ssh key to slave root@localhost:/home/mrprod# sudo su mrprod localhost:~> pwd /home/mrprod localhost:~> mkdir .ssh localhost:~> chmod 0700 .ssh localhost:~> cd .ssh localhost:~/.ssh> touch authorized_keys localhost:~/.ssh> chmod 0600 authorized_keys #then put the public key in authorized_keys ● ssh will not work if you forget the chmod step
  • 28. Add ssh key to jenkins
  • 29. Add ssh key to jenkins (2)
  • 31. Make a label for nodes
  • 33. Starting and Stopping http://sample.dynalias.org:8080/quietDown http://sample.dynalias.org:8080/cancelQuietDown ${JENKINSURL}/${ACTION} #------ $ sudo /etc/init.d/jenkins restart ● Other valid choices for the ACTION: start|stop|status|restart| force-reload ● A good idea to quietDown first so you don't stop jobs in progress
  • 34. Thank You Slides will be found at http://platypiventures.com/perl/present And the conference website
  • 35. Slides of the Rigged Demo These were replaced by the live demo
  • 39. What do you want to look for?
  • 42. Source Code Settings ● Git needs a plugin
  • 43. Add Code to Do Something ● Add a shell to do the real work. Today with bash, but also supports Groovy and anything you can call
  • 44. Script Part 1 #!/bin/bash # make sure we have place to write the output # if no directory build one, blow away a file it it is in the way if [[ ! -d $WORKSPACE/output ]] ; then if [[ -e $WORKSPACE/output ]] ; then rm $WORKSPACE/output fi mkdir $WORKSPACE/output fi ls -aFlR $WORKSPACE report="$WORKSPACE/output/found.html" hostname whoami pwd cd ../../jobs pwd echo "<h1>$Pattern</h1> ( $Settings )<hr>" > $report
  • 45. Script Part 2 jenkinsgrep () { for dir in * ; do echo "nn--------------- $dir" local results=$(grep $Settings $Pattern $dir/config.xml) if [[ -n $results ]]; then echo $results # echo "<h2>$dir</h2>" >> $report echo "<h2><a href='${JENKINS_URL}job/$dir/configure'>$dir</a></h2>" >> $report echo "<pre>$results</pre>" >> $report fi done } jenkinsgrep
  • 46. Add an HTML report
  • 48. The End (Again) Check github for slides and the config.xml files for the jobs discussed