| 12345678910111213141516 |
- #!/usr/bin/env groovy
- def call(String secret = '') {
- def notifier = new org.feishu.FeishuNotifier()
- def status = currentBuild.currentResult // SUCCESS/FAILED/ABORTED
- def emoji = status == 'SUCCESS' ? '✅' : '❌'
- def msg = """**构建结束**
- 项目:${env.JOB_NAME} #${env.BUILD_NUMBER}
- 结果:**${status}**
- 耗时:${currentBuild.durationString.replace(' and counting', '')}"""
- notifier.send(
- webhook: env.FEISHU_WEBHOOK,
- secret : secret,
- title : "$emoji Jenkins 构建$status",
- text : msg
- )
- }
|