-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile_cleanup.groovy
34 lines (31 loc) · 1.23 KB
/
Jenkinsfile_cleanup.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
pipeline {
agent any
parameters {
string(defaultValue: "10.1.1.4", description: 'Controller (UDF URL / IP Address)', name: 'controllerUrl')
string(defaultValue: "[email protected]", description: 'Controller Username', name: 'username')
password(defaultValue: "", description: 'Controller Password', name: 'password')
string(defaultValue: "#nginx_demo_slack_integ", description: 'Notification channel name. (For notifying a user instead of channel, use @Member_ID)', name: 'slack_channel')
}
tools {
nodejs "node"
}
stages {
stage('Clean up Controller') {
steps {
sh '''
set +x
./Scripts/CleanupArtifact.sh $controllerUrl $username $password
set -x
'''
}
}
}
post {
always{
slackSend channel: "${slack_channel}",
color: COLOR_MAP[currentBuild.currentResult],
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}"
}
}
}