Skip to content

Commit 71a8870

Browse files
Removing RocketChat from Jenkinsfile
1 parent 2ae2f7f commit 71a8870

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

Jenkinsfile

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ String mavenCentralCredentialsId = '87bfb2d4-7613-4816-9fe1-70dfd7e6dec2' // id
3232
String mavenCentralSignKeyFileId = 'dc96216c-d20a-48ff-98c0-1c7ba096d08d' // id that matches the maven central sign key file set as jenkins property
3333
String mavenCentralSignKeyId = 'a1357827-1516-4fa2-ab8e-72cdea07a692' // id that matches the maven central sign key id set as jenkins property
3434

35-
/* Rocket.Chat configuration */
36-
String rocketChatChannel = 'jenkins'
37-
3835
/**
3936
* pipeline configuration
4037
*/
@@ -66,9 +63,6 @@ node {
6663
/* prs from forks require a special handling*/
6764
String headGitCheckoutUrl = prJsonObj == null ? gitCheckoutUrl : prJsonObj.head.repo.ssh_url
6865

69-
// notify rocket chat
70-
notifyRocketChat(rocketChatChannel, ':jenkins_triggered:', buildStartMsg(currentBranchName, targetBranchName, projectName))
71-
7266
// checkout scm
7367
String commitHash = ""
7468
stage('checkout') {
@@ -188,15 +182,6 @@ node {
188182
// deploy java docs
189183
deployJavaDocs(projectName, sshCredentialsId, gitCheckoutUrl)
190184
}
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)
200185
}
201186
}
202187

@@ -212,10 +197,6 @@ node {
212197
]) {
213198
sh "curl -s https://codecov.io/bash | bash -s - -t ${env.codeCovToken} -C ${commitHash}"
214199
}
215-
216-
// notify Rocket.Chat
217-
String successMsg = buildSuccessMsg(currentBranchName, targetBranchName, projectName)
218-
notifyRocketChat(rocketChatChannel, ':jenkins_party:', successMsg)
219200
}
220201

221202
} catch (Exception e) {
@@ -228,15 +209,6 @@ node {
228209
// print exception
229210
Date date = new Date()
230211
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)
240212
}
241213

242214
}
@@ -471,35 +443,6 @@ def publishReports(String relativeProjectDir) {
471443
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: true, reportDir: relativeProjectDir + '/build/reports/spotbugs', reportFiles: 'main.html', reportName: "${relativeProjectDir}_spotbugs_report", reportTitles: ''])
472444
}
473445

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-
503446
def prFromFork() {
504447
return env.CHANGE_FORK != null
505448
}

0 commit comments

Comments
 (0)