Jenkins Notifications via Email
- We need Jenkins to report failures or feedback and for that we will be using Email configuration.
Jenkins Email configuration
- In all the latest installations of jenkins, a plugin called Email-Ext is already part of basic plugins, if not please install this plugin
- Navigate to Manage Jenkins => Configure System
- Navigate to Email Notification Section
- Naviagate to Extended Email Notification Section
- Navigate to Email Notification Section
Jenkins Pipeline Project without having much knowledge of groovy
- Create a Jenkins pipeline project
- Navigate through all the sections
- Click on Pipeline Syntax
- Try to review the steps done for building the project in free style
- Git
- Invoke Top level targets or
mvn package
- publish junit test results
- archived the artifacts
- Pipleline which we are using is called as Scripted Pipeline and basic syntax of scripted pipeline
node('<LABEL>') {
stage('<stage name 1>') {
}
stage('<stage name 2>') {
}
}
- Now lets try to create the basic script for executing our gol and lets have stages scm, build, postbuild
node('REDHAT'){
stage('scm'){
}
stage('build'){
}
stage('postbuild'){
}
}
-
Now lets use generator to generate script for the git and copy the script to the pipeline
-
Now do the same stuff for other steps
-
Now lets build the project
-
The pipeline will be of more benifit if we have this script for building jenkins in our version control system
- Store Jenkins pipleline script in a file called as Jenkinsfile in the root directory of your git
- Now lets simply create a new Jenkins pipeline Job
- Now build the project
- Advantage of Jenkinsfile in VCS will help us in having jenkinssteps version controlled and we can make changes in Jenkins jobs without changing ui
- Store Jenkins pipleline script in a file called as Jenkinsfile in the root directory of your git