- Download the war
wget http://ftp-chi.osuosl.org/pub/jenkins/war/2.161/jenkins.war - Start it
nohup java -Duser.home=/opt/jenkins/jenkins_home -Duser.timezone=America/Chicago -jar lib/jenkins.war --httpsPort=8080 & - Configure it
http://localhost:8080 - Blue Ocean & Create pipeline
http://localhost:8080/blue - Create slaves/agents
Dashboard > Manage Jenkins > Mange Nodes > ....
The nodes: - can be any type of machine
- can be manually activate/inactivate
Wednesday, May 22, 2019
Jenkins - Installation
Tuesday, May 21, 2019
Jenkins - Pipeline Syntax
The Jenkins Pipeline Syntax page (https://jenkins.io/doc/book/pipeline/syntax/)
Agent - specifies where the entire Pipeline, or a specific stage, will execute in the Jenkins environment depending on where the
Post - defines one or more additional steps that are run upon the completion of a Pipeline’s or stage’s run (depending on the location of the
Steps - the
Environment - specifies a sequence of key-value pairs which will be defined as environment variables for the all steps, or stage-specific steps, depending on where the
Triggers - support cron, pollSCM and upstream
When - Pipeline to determine whether the stage should be executed depending on the given condition.
Sequential/Parallel
Agent - specifies where the entire Pipeline, or a specific stage, will execute in the Jenkins environment depending on where the
agent
section is placed. It support docker and dockerfile in it.Post - defines one or more additional steps that are run upon the completion of a Pipeline’s or stage’s run (depending on the location of the
post
section within the Pipeline). post
can support any of of the following post-condition blocks: always
, changed
, fixed
, regression
, aborted
, failure
, success
, unstable
, unsuccessful
, and cleanup
Stags - c
ontaining a sequence of one or more stage directives.Steps - the
steps
section defines a series of one or more steps to be executed in a given stage
directive.Environment - specifies a sequence of key-value pairs which will be defined as environment variables for the all steps, or stage-specific steps, depending on where the
environment
directive is located within the Pipeline.environment {
SERVICE_CREDS = credentials('my-prefined-username-password')
}
Options/Parameters - Triggers - support cron, pollSCM and upstream
When - Pipeline to determine whether the stage should be executed depending on the given condition.
Sequential/Parallel
pipeline {
agent any
options {
parallelsAlwaysFailFast()
}
stages {
stage('Non-Parallel Stage') {
steps {
echo 'This stage will be executed first.'
}
}
stage('Parallel Stage') {
when {
branch 'master'
}
parallel {
stage('Branch A') {
agent {
label "for-branch-a"
}
steps {
echo "On Branch A"
}
}
stage('Branch B') {
agent {
label "for-branch-b"
}
steps {
echo "On Branch B"
}
}
}
}
}
Subscribe to:
Posts (Atom)