티스토리 뷰
$ curl -X POST -H 'Authorization: Bearer gcJU95ghZ1i2VlyYVYfy1FES63hA9kXAvL9rPb5epjn' -F 'message=Hello Line' https://notify-api.line.me/api/notify {"status":200,"message":"ok"} $ |
#!groovy node { try { stage 'Checkout' checkout scm stage 'Build and test' sh './gradlew clean check' currentBuild.result = 'SUCCESS' } catch (err) { currentBuild.result = 'FAILURE' } stage 'Notify' notifyLINE('0nWiXPLLlSPpYnkdRhgIXirmmYFNcjh4VQyu2VQja7x', currentBuild.result) }
def notifyLINE(token, result) { def isFailure = result == 'FAILURE'
def url = 'https://notify-api.line.me/api/notify' def message = "Build ${env.BRANCH_NAME}, result is ${result}. \n${env.BUILD_URL}" def imageThumbnail = isFailure ? 'http://developers.linecorp.com/blog/wp-content/uploads/2016/10/moon.png' : '' def imageFullsize = isFailure ? 'http://developers.linecorp.com/blog/wp-content/uploads/2016/10/moon.png' : ''
sh "curl ${url} -H 'Authorization: Bearer ${token}' -F 'message=${message}' -F 'imageThumbnail=${imageThumbnail}' -F 'imageFullsize=${imageFullsize}'" } |
def notifyLINE(token, result, branchName, branchUrl) { def isFailure = result == 'FAILURE'
def url = 'https://notify-api.line.me/api/notify' def message = "Build ${branchName}, result is ${result}. \n${branchUrl}" def imageThumbnail = isFailure ? 'http://developers.linecorp.com/blog/wp-content/uploads/2016/10/moon.png' : '' def imageFullsize = isFailure ? 'http://developers.linecorp.com/blog/wp-content/uploads/2016/10/moon.png' : ''
def command = "curl ${url} -H 'Authorization: Bearer ${token}' -F 'message=${message}' -F 'imageThumbnail=${imageThumbnail}' -F 'imageFullsize=${imageFullsize}'" print command command.execute() } notifyLINE('6PUqyn2iEJ1jxgfT0HmuR6vb61H8vKPstzv2LOtSMZb', manager.build.result, 'TestJob', 'http://testJob.com/jenkins/job/TestJob/' + manager.build.number) |
참고
- Total
- Today
- Yesterday
- json
- HADOOP
- spring
- flume
- mongodb
- jackson
- mongo
- Oracle
- Sqoop
- PYTHON
- 책요약
- jenkins
- Git
- db
- Django
- java
- 확률분포
- 알고리즘
- spark
- Learning Spark
- 통계학
- Apache Spark
- Hdfs
- linux
- CI
- jenkins2.0
- 태그를 입력해 주세요.
- bigdata
- exception
- mysql
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |