-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.groovy
44 lines (38 loc) · 1.06 KB
/
script.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
35
36
37
38
39
40
41
42
43
44
def buildApp()
{
echo 'Building the application1'
}
def testApp()
{
echo 'Testing the application1'
}
def deployApp()
{
echo 'Deploying the application to Production'
echo ' Deploying vesrion ${params.version} '
}
def getChangeString() {
MAX_MSG_LEN = 100
def changeString = ""
echo "Gathering SCM changes"
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
truncated_msg = entry.msg.take(MAX_MSG_LEN)
changeString += " - ${truncated_msg} [${entry.author}]\n"
}
}
if (!changeString) {
changeString = " - No new changes"
}
return changeString
}
def sendEmail(status) {
mail(
to: "[email protected]",
subject: "Build $BUILD_NUMBER - " + status + " (${currentBuild.fullDisplayName})",
body: "Changes:\n " + "\n\n Check console output at: $BUILD_URL/console" + "\n")
}
return this