Update feishu_notify.sh
This commit is contained in:
@@ -3,14 +3,13 @@ set -e
|
||||
|
||||
# ===== 参数校验 =====
|
||||
: "${FEISHU_WEBHOOK:?FEISHU_WEBHOOK not set}"
|
||||
: "${JENKINS_USER:?JENKINS_USER not set}"
|
||||
: "${JENKINS_TOKEN:?JENKINS_TOKEN not set}"
|
||||
: "${JENKINS_API_CREDENTIAL:?JENKINS_API_CREDENTIAL not set}"
|
||||
|
||||
# ===== 获取构建状态 =====
|
||||
getBuildState() {
|
||||
local buildNr=$1
|
||||
curl -s -u "${JENKINS_USER}:${JENKINS_TOKEN}" \
|
||||
"${JOB_URL}/${buildNr}/api/json" \
|
||||
curl -s -u "${JENKINS_API_CREDENTIAL}" \
|
||||
"${BUILD_URL}api/json" \
|
||||
| grep -Po '"result":\s*"\K\w+'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user