Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-12478

remove jenkins job slack notification boiler plate

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Continuous Integration
    • Labels:
      None
    • Templates:
    • Story Points:
      0.625
    • Epic Link:
    • Team:
      SQuaRE

      Description

      As part of converting the tag-git-repos job to jenkins pipeline, a new convience method named notify.wrap() was introduced that can replace this chunk of boilerplate that is current present in most (all?) of our pipeline scripts:

      try {
        notify.started()
        // do stuff
      } catch (e) {
        // If there was an exception thrown, the build failed
        currentBuild.result = "FAILED"
        throw e
      } finally {
        echo "result: ${currentBuild.result}"
        switch(currentBuild.result) {
          case null:
          case 'SUCCESS':
            notify.success()
            break
          case 'ABORTED':
            notify.aborted()
            break
          case 'FAILURE':
            notify.failure()
            break
          default:
            notify.failure()
        }
      }
      

      Which may be converted to:

      notify.wrap {
        // do stuff
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jhoblitt Joshua Hoblitt
                Reporter:
                jhoblitt Joshua Hoblitt
                Reviewers:
                Joshua Hoblitt
                Watchers:
                Joshua Hoblitt, Kian-Tat Lim, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel