Skip to content

Commit 7d07a62

Browse files
committed
🔧 chore[Jenkinsfile]: enhance pipeline report with improved formatting, status icons, and execution timestamp
1 parent aff7850 commit 7d07a62

1 file changed

Lines changed: 41 additions & 11 deletions

File tree

Jenkinsfile

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,51 @@ pipeline {
102102
post {
103103
always {
104104
script {
105-
def color = (currentBuild.result == 'SUCCESS') ? 65280 : 16711680
106-
def status = (currentBuild.result == 'SUCCESS') ? 'Success' : 'Failure'
105+
def color = (currentBuild.result == 'SUCCESS') ? 3066993 : 15158332
106+
def status = (currentBuild.result == 'SUCCESS') ? '✅ Success' : '❌ Failure'
107+
def timestamp = new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone('UTC'))
107108

108109
def payload = [
109110
content: null,
110111
embeds: [[
111-
title: "Pipeline Report",
112-
description: """
113-
**Job**: ${env.JOB_NAME} [#${env.BUILD_NUMBER}]\n
114-
**Status**: ${status}\n
115-
**Branch**: ${env.BRANCH_NAME ?: 'unknown'}\n
116-
**Author**: ${env.LAST_COMMIT_AUTHOR ?: 'unknown'}\n
117-
**Commit Message**: ${env.LAST_COMMIT_MESSAGE ?: 'unknown'}
118-
""",
119-
color: color
112+
title: "🚀 Pipeline Execution Report For BSO Blog Front-end",
113+
description: "Pipeline execution details below:",
114+
color: color,
115+
thumbnail: [
116+
url: "https://raw.githubusercontent.com/bsospace/assets/refs/heads/main/LOGO/LOGO%20WITH%20CIRCLE.ico"
117+
],
118+
fields: [
119+
[
120+
name: "Job",
121+
value: "${env.JOB_NAME} [#${env.BUILD_NUMBER}]",
122+
inline: true
123+
],
124+
[
125+
name: "Status",
126+
value: status,
127+
inline: true
128+
],
129+
[
130+
name: "Branch",
131+
value: "${env.BRANCH_NAME ?: 'unknown'}",
132+
inline: true
133+
],
134+
[
135+
name: "Author",
136+
value: "${env.LAST_COMMIT_AUTHOR ?: 'unknown'}",
137+
inline: true
138+
],
139+
[
140+
name: "Commit Message",
141+
value: "${env.LAST_COMMIT_MESSAGE ?: 'unknown'}",
142+
inline: false
143+
]
144+
],
145+
footer: [
146+
text: "Pipeline executed at",
147+
icon_url: "https://raw.githubusercontent.com/bsospace/assets/refs/heads/main/LOGO/LOGO%20WITH%20CIRCLE.ico"
148+
],
149+
timestamp: timestamp
120150
]]
121151
]
122152

0 commit comments

Comments
 (0)