Skip to content

Commit

Permalink
slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Aren Chen committed Jun 19, 2018
1 parent 0f3d18e commit 5a273f6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ services:
go:
- "1.10.x"

notifications:
slack: 'linkernetowrks:yNZgH7vJ2dFnmQEl0k1T6xHR'

cache:
directories:
- vendor/github.com
Expand Down
24 changes: 24 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ pipeline {
sh "make clean"
}
}
failure {
script {
def message = "<https://jenkins.linkernetworks.co/job/vortex/job/vortex/|vortex> » " +
"<${env.JOB_URL}|${env.BRANCH_NAME}> » " +
"<${env.BUILD_URL}|#${env.BUILD_NUMBER}> failed."

slackSend channel: '#09_jenkins', color: 'danger', message: message

switch (env.BRANCH_NAME) {
case ~/(.+-)?rc(-.+)?/:
case ~/develop/:
case ~/master/:
message += " <!here>"
slackSend channel: '#01_vortex', color: 'danger', message: message
break
}
}
}
fixed {
slackSend channel: '#09_jenkins', color: 'good',
message: "<https://jenkins.linkernetworks.co/job/vortex/job/vortex/|vortex> » " +
"<${env.JOB_URL}|${env.BRANCH_NAME}> » " +
"<${env.BUILD_URL}|#${env.BUILD_NUMBER}> is fixed."
}
}
options {
timestamps()
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ all: build test

.PHONY: pre-build
pre-build:
ls /aaa/bbb
$(MAKE) govendor-sync

.PHONY: build
Expand Down

0 comments on commit 5a273f6

Please sign in to comment.