Skip to content

Commit

Permalink
Update Jenkinsfile7AMNovBatch2022
Browse files Browse the repository at this point in the history
  • Loading branch information
devopstrainingblr authored Jan 9, 2023
1 parent a4e1d68 commit a8eb2dc
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions Jenkinsfile7AMNovBatch2022
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node('nodes'){
node{

properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')), [$class: 'JobLocalConfiguration', changeReasonComment: ''], pipelineTriggers([pollSCM('* * * * *')])])

Expand Down Expand Up @@ -45,32 +45,5 @@ sendSlackNotifications(currentBuild.result)

}

//Slack Send Notifications

def sendSlackNotifications(String buildStatus = 'STARTED') {
// build status of null means successful
buildStatus = buildStatus ?: 'SUCCESS'

// Default values
def colorName = 'RED'
def colorCode = '#FF0000'
def subject = "${buildStatus}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'"
def summary = "${subject} (${env.BUILD_URL})"

// Override default values based on build status
if (buildStatus == 'STARTED') {
colorName = 'ORANGE'
colorCode = '#FFA500'
} else if (buildStatus == 'SUCCESS') {
colorName = 'GREEN'
colorCode = '#00FF00'
} else {
colorName = 'RED'
colorCode = '#FF0000'
}

// Send notifications
slackSend (color: colorCode, message: summary, channel: '#icicibank')
}


0 comments on commit a8eb2dc

Please sign in to comment.