1、飞书群里添加机器人
飞书群里添加机器人,保存好对应的webhook地址,在下面python脚本中用到
使用文档,参考:开发文档 - 飞书开放平台

2、Jenkins构建完成后发送飞书通知
使用python脚本,发送飞书通知
代码如下:
# -*- encoding: utf-8 -*-
"""
@Author : 袋鼠KK
@File :webhook.py
@Time :2023/5/16
@Remark :飞书通知
"""
import requests
# 飞书机器人的webhook地址
url = “https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxx”
method = "post"
headers = {"Content-Type": "application/json"}
"""
last_build_number: Jenkins最后一次构建number
last_build_result: Jenkins最后一次构建结果
last_build_report: Jenkins最后一次构建输出报告
"""
last_build_report = jenkins_url + "job/" + job_name + "/HTML_20Report/" + job_name + "_" + str(last_build_number) + ".html"
4588



被折叠的 条评论
为什么被折叠?



