Git Product home page Git Product logo

jenkins-scripts's Introduction

jenkins-scripts

Jenkins Pipeline Scripts

Steps to enable the notificaiton feature

Description: It's always a good practice to send an exception whenever any required stages gets failed during the pipeline execution.

Pre-requisites:

  1. LTS version of Jenkins must be setup and working as exepcted.

Steps:

  1. Add these plugins from Jenkin's "Manage Jenkins -> Manage Plugins" section : Email-ext, Email Notification Plugin, and Email-ext Template plugin.
  2. Configure the SMTP from Jenkin's Manage Jenkins -> Configure System".
  3. Test the configuration. If configurations are proper it will show as "Email Test Successfull".
  4. Apply and Save.

Execution Steps:

  1. Use the sample script as a reference.
  2. Replace the email id with the one where you want to get a notification.

Challenges faced:

  1. Test Email Configuration was failing: Solution: After upgrading the Jenkins LTS version it has solved the issue.
  2. Adding try-catch block was not working: Solution: As of now I know only two types of "Pipelines syantax" not sure if there are more way to write. Since as part of this samply script I am using "Declarative Pipeline fundamentals" so to handle try-catch is different from "Scripted Pipeline fundamentals" but overall fundmentail reamins same. In case of declarative we have use "script" with "stages -> stage -> steps" to handle try-catch else it may throw error.

Reference: Jenkins pipleline syntax guidelines[https://www.jenkins.io/doc/book/pipeline/#:~:text=Declarative%20Pipeline%20syntax.-,Node,part%20of%20Scripted%20Pipeline%20syntax.]

Note: "Scripted Pipeline fundamentals" pipeline sytanx looks straight forward so you may choose that for simplicity.

jenkins-scripts's People

Contributors

vikashchoudahry avatar vikashkrchoudhary avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.