@@ -274,43 +274,6 @@ def determineBuildType() {
274274 return buildType
275275}
276276
277- def notifySlack (status = ' started' ) {
278- // Notify Slack channel for every build except adhoc executions
279- if (params. ADHOC_BUILD_TYPE != ' BUILD-AND-EXECUTE-TESTS' ) {
280- // Set the global pipeline scoped environment (this is above each matrix)
281- env. BUILD_STATED_SLACK_NOTIFIED = ' true'
282-
283- def buildType = determineBuildType()
284- if (buildType == ' release' ) {
285- buildType + = " v${ env.DRIVER_VERSION} "
286- }
287- buildType = buildType. capitalize()
288-
289- def color = ' good' // Green
290- if (status. equalsIgnoreCase(' aborted' )) {
291- color = ' 808080' // Grey
292- } else if (status. equalsIgnoreCase(' unstable' )) {
293- color = ' warning' // Orange
294- } else if (status. equalsIgnoreCase(' failed' )) {
295- color = ' danger' // Red
296- }
297-
298- def message = """ Build ${ status} for ${ env.DRIVER_DISPLAY_NAME} [${ buildType} ]
299- <${ env.GITHUB_BRANCH_URL} |${ env.BRANCH_NAME} > - <${ env.RUN_DISPLAY_URL} |#${ env.BUILD_NUMBER} > - <${ env.GITHUB_COMMIT_URL} |${ env.GIT_SHA} >"""
300- if (params. CI_SCHEDULE != ' DO-NOT-CHANGE-THIS-SELECTION' ) {
301- message + = " - ${ env.OS_VERSION} "
302- }
303- if (! status. equalsIgnoreCase(' Started' )) {
304- message + = """
305- ${ status} after ${ currentBuild.durationString - ' and counting'} """
306- }
307-
308- slackSend color : " ${ color} " ,
309- channel : " #cpp-driver-dev-bots" ,
310- message : " ${ message} "
311- }
312- }
313-
314277def describePerCommitStage () {
315278 script {
316279 currentBuild. displayName = " Per-Commit build of ${ env.BRANCH_NAME} "
@@ -574,11 +537,6 @@ pipeline {
574537 stage(' Initialize-Environment' ) {
575538 steps {
576539 initializeEnvironment()
577- script {
578- if (env. BUILD_STATED_SLACK_NOTIFIED != ' true' ) {
579- notifySlack()
580- }
581- }
582540 }
583541 }
584542 stage(' Describe-Build' ) {
@@ -657,20 +615,6 @@ pipeline {
657615 }
658616 }
659617 }
660- post {
661- aborted {
662- notifySlack(' aborted' )
663- }
664- success {
665- notifySlack(' completed' )
666- }
667- unstable {
668- notifySlack(' unstable' )
669- }
670- failure {
671- notifySlack(' FAILED' )
672- }
673- }
674618 }
675619
676620 stage(' Build-Release-And-Deploy' ) {
@@ -706,11 +650,6 @@ pipeline {
706650 stage(' Initialize-Environment' ) {
707651 steps {
708652 initializeEnvironment()
709- script {
710- if (env. BUILD_STATED_SLACK_NOTIFIED != ' true' ) {
711- notifySlack()
712- }
713- }
714653 }
715654 }
716655 stage(' Describe-Release-And-Deploy' ) {
@@ -740,20 +679,6 @@ pipeline {
740679 }
741680 }
742681 }
743- post {
744- aborted {
745- notifySlack(' aborted' )
746- }
747- success {
748- notifySlack(' completed' )
749- }
750- unstable {
751- notifySlack(' unstable' )
752- }
753- failure {
754- notifySlack(' FAILED' )
755- }
756- }
757682 }
758683
759684 stage(' Scheduled-And-Adhoc-Testing' ) {
@@ -812,11 +737,6 @@ pipeline {
812737 stage(' Initialize-Environment' ) {
813738 steps {
814739 initializeEnvironment()
815- script {
816- if (env. BUILD_STATED_SLACK_NOTIFIED != ' true' ) {
817- notifySlack()
818- }
819- }
820740 }
821741 }
822742 stage(' Describe-Build' ) {
@@ -860,20 +780,6 @@ pipeline {
860780 }
861781 }
862782 }
863- post {
864- aborted {
865- notifySlack(' aborted' )
866- }
867- success {
868- notifySlack(' completed' )
869- }
870- unstable {
871- notifySlack(' unstable' )
872- }
873- failure {
874- notifySlack(' FAILED' )
875- }
876- }
877783 }
878784
879785 stage(' Scheduled-And-Adhoc-Build-Documents' ) {
@@ -910,9 +816,6 @@ pipeline {
910816 stage(' Initialize-Environment' ) {
911817 steps {
912818 initializeEnvironment()
913- script {
914- notifySlack()
915- }
916819 }
917820 }
918821 stage(' Describe-Build' ) {
@@ -931,20 +834,6 @@ pipeline {
931834 }
932835 }
933836 }
934- post {
935- aborted {
936- notifySlack(' aborted' )
937- }
938- success {
939- notifySlack(' completed' )
940- }
941- unstable {
942- notifySlack(' unstable' )
943- }
944- failure {
945- notifySlack(' FAILED' )
946- }
947- }
948837 }
949838 }
950839}
0 commit comments