Bläddra i källkod

fix: add_Jenkins_构建者属性

李时威 1 år sedan
förälder
incheckning
f40bb00c14
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      deploy/Jenkinsfile

+ 3 - 2
deploy/Jenkinsfile

@@ -10,6 +10,7 @@ pipeline {
     IMAGE_REPO = "SXKJ:32775"
     TAB = "\n   \n  "
     GIT_LOG = sh (script: "git log --oneline -n 1", returnStdout: true).trim()
+    BUILD_USER_NAME = sh(script: "git log -1 --pretty=format:'%an'", returnStdout: true).trim()
     TITLE = "${JOB_BASE_NAME}-${ENV_APP}"
     TIMESTAMP = sh(returnStdout: true, script: "TZ=Asia/Shanghai date  +'%F_%H-%M-%S'").trim()
     TAG = "${ENV_APP}-${TIMESTAMP}"
@@ -70,7 +71,7 @@ pipeline {
                     "msgtype": "markdown",
                     "markdown": {
                         "title":"${TITLE}",
-                        "text": "😄👍 构建成功 👍😄  \n**项目名称**:${TITLE}  \n**Git log**: ${GIT_LOG}  \n**构建分支**: ${GIT_BRANCH}   \n**构建地址**:${BUILD_URL}  \n**构建任务**: ${BUILD_TASKS}"
+                        "text": "😄👍 构建成功 👍😄  \n**项目名称**:${TITLE}  \n**Git log**: ${GIT_LOG}   \n**构建者**: ${BUILD_USER_NAME}  \n**构建分支**: ${GIT_BRANCH}   \n**构建地址**:${BUILD_URL}  \n**构建任务**: ${BUILD_TASKS}"
                     }
                 }'
         """
@@ -84,7 +85,7 @@ pipeline {
                     "msgtype": "markdown",
                     "markdown": {
                         "title":"${TITLE}",
-                        "text": "😖❌ 构建失败 ❌😖  \n**项目名称**:${TITLE}  \n**Git log**: ${GIT_LOG}   \n**构建分支**: ${GIT_BRANCH}  \n**构建地址**:${BUILD_URL}  \n**构建任务**: ${BUILD_TASKS}"
+                        "text": "😖❌ 构建失败 ❌😖  \n**项目名称**:${TITLE}  \n**Git log**: ${GIT_LOG}   \n**构建者**: ${BUILD_USER_NAME}   \n**构建分支**: ${GIT_BRANCH}  \n**构建地址**:${BUILD_URL}  \n**构建任务**: ${BUILD_TASKS}"
                     }
                 }'
         """