From 29bcbbdb72b230da91029e50090527b787fe0798 Mon Sep 17 00:00:00 2001 From: xiangning Date: Fri, 3 Jul 2026 18:12:29 +0800 Subject: [PATCH] fix: clean Jenkinsfile (single-quote sh blocks) --- Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 67b8c5b..e3fd097 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,9 +25,16 @@ def feishuNotify = { String result, String failedStageName = "" -> if (burl == null) { burl = "http://115.191.51.246:8080/job/" + env.JOB_NAME.replace("/", "/job/") + "/" } elements.add([tag: "action", actions: [[tag: "button", text: [tag: "plain_text", content: "查看构建"], url: burl, type: isOk ? "primary" : "danger"]]]) def card = [msg_type: "interactive", card: [header: [title: [tag: "plain_text", content: title], template: color], elements: elements]] + def ts = String.valueOf(System.currentTimeMillis() / 1000L as long) + def stringToSign = ts + "\n" + "Qp6SwLIkgRJEtV9UsOf6mg" + def mac = javax.crypto.Mac.getInstance("HmacSHA256") + mac.init(new javax.crypto.spec.SecretKeySpec(stringToSign.getBytes("UTF-8"), "HmacSHA256")) + def sign = mac.doFinal().encodeBase64().toString() + card.timestamp = ts + card.sign = sign def jsonStr = groovy.json.JsonOutput.toJson(card) writeFile file: "/tmp/feishu_msg.json", text: jsonStr - sh 'curl -sS -X POST https://open.feishu.cn/open-apis/bot/v2/hook/d215e8ed-edea-4f07-a77c-2a0e5b52d9b9 -H "Content-Type: application/json" -d @/tmp/feishu_msg.json || true' + sh 'curl -sS -X POST https://open.feishu.cn/open-apis/bot/v2/hook/921d9874-de0a-4eca-9ca6-66bf91bd2fbc -H "Content-Type: application/json" -d @/tmp/feishu_msg.json || true' sh 'rm -f /tmp/feishu_msg.json' }