DevOps Classroom Series – 15/May/2020

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

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
    1. Git
    2. Invoke Top level targets or mvn package
    3. publish junit test results
    4. 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

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%