@@ -32,9 +32,6 @@ String mavenCentralCredentialsId = '87bfb2d4-7613-4816-9fe1-70dfd7e6dec2' // id
32
32
String mavenCentralSignKeyFileId = ' dc96216c-d20a-48ff-98c0-1c7ba096d08d' // id that matches the maven central sign key file set as jenkins property
33
33
String mavenCentralSignKeyId = ' a1357827-1516-4fa2-ab8e-72cdea07a692' // id that matches the maven central sign key id set as jenkins property
34
34
35
- /* Rocket.Chat configuration */
36
- String rocketChatChannel = ' jenkins'
37
-
38
35
/**
39
36
* pipeline configuration
40
37
*/
66
63
/* prs from forks require a special handling*/
67
64
String headGitCheckoutUrl = prJsonObj == null ? gitCheckoutUrl : prJsonObj. head. repo. ssh_url
68
65
69
- // notify rocket chat
70
- notifyRocketChat(rocketChatChannel, ' :jenkins_triggered:' , buildStartMsg(currentBranchName, targetBranchName, projectName))
71
-
72
66
// checkout scm
73
67
String commitHash = " "
74
68
stage(' checkout' ) {
@@ -188,15 +182,6 @@ node {
188
182
// deploy java docs
189
183
deployJavaDocs(projectName, sshCredentialsId, gitCheckoutUrl)
190
184
}
191
-
192
- // notify rocket chat
193
- String successMsg = " deployment of version $projectVersion from branch '$currentBranchName ' to sonatype " +
194
- " successful. If this is a deployment from 'main' pls remember visiting https://oss.sonatype.org to " +
195
- " stag and release artifact!\n " +
196
- " *project:* ${ projectName} \n " +
197
- " *branch:* ${ currentBranchName} \n "
198
-
199
- notifyRocketChat(rocketChatChannel, ' :jenkins_party:' , successMsg)
200
185
}
201
186
}
202
187
@@ -212,10 +197,6 @@ node {
212
197
]) {
213
198
sh " curl -s https://codecov.io/bash | bash -s - -t ${ env.codeCovToken} -C ${ commitHash} "
214
199
}
215
-
216
- // notify Rocket.Chat
217
- String successMsg = buildSuccessMsg(currentBranchName, targetBranchName, projectName)
218
- notifyRocketChat(rocketChatChannel, ' :jenkins_party:' , successMsg)
219
200
}
220
201
221
202
} catch (Exception e) {
@@ -228,15 +209,6 @@ node {
228
209
// print exception
229
210
Date date = new Date ()
230
211
println (" [ERROR] [${ date.format("dd/MM/yyyy")} - ${ date.format("HH:mm:ss")} ] " + e)
231
-
232
- // notify rocket chat
233
- net.sf.json.JSONObject prJsonObj = getPRJsonObj(orgName, projectName, env. CHANGE_ID )
234
- String branchName = prJsonObj == null ? env. BRANCH_NAME : prJsonObj. head. ref
235
- String errorMsg = " CI failed.\n " +
236
- " *project:* ${ projectName} \n " +
237
- " *branch:* ${ branchName} \n " +
238
- " *error:* ${ e.getMessage()} \n "
239
- notifyRocketChat(rocketChatChannel, ' :jenkins_explode:' , errorMsg)
240
212
}
241
213
242
214
}
@@ -471,35 +443,6 @@ def publishReports(String relativeProjectDir) {
471
443
publishHTML([allowMissing : true , alwaysLinkToLastBuild : true , escapeUnderscores : false , keepAll : true , reportDir : relativeProjectDir + ' /build/reports/spotbugs' , reportFiles : ' main.html' , reportName : " ${ relativeProjectDir} _spotbugs_report" , reportTitles : ' ' ])
472
444
}
473
445
474
- /* Rocket.Chat */
475
-
476
- def notifyRocketChat (String rocketChatChannel , String emoji , String message ) {
477
- rocketSend channel : rocketChatChannel, emoji : emoji,
478
- message : message
479
- rawMessage : true
480
- }
481
-
482
- def buildSuccessMsg (String currentBranchName , String targetBranchName , String projectName ) {
483
-
484
- String msg = " Build successful!\n " +
485
- " *project:* ${ projectName} \n " +
486
- " *branch:* ${ currentBranchName} \n "
487
- String targetBranch = targetBranchName != null ? " *target:* ${ targetBranchName} \n " : " "
488
-
489
-
490
- return msg + targetBranch
491
- }
492
-
493
- def buildStartMsg (String currentBranchName , String targetBranchName , String projectName ) {
494
-
495
- String msg = " Build triggered.\n " +
496
- " *project:* ${ projectName} \n " +
497
- " *branch:* ${ currentBranchName} \n "
498
- String targetBranch = targetBranchName != null ? " *target:* ${ targetBranchName} \n " : " "
499
-
500
- return msg + targetBranch
501
- }
502
-
503
446
def prFromFork () {
504
447
return env. CHANGE_FORK != null
505
448
}
0 commit comments