From d5b5b748e5268cee593be9f9948df1eb0ab6600e Mon Sep 17 00:00:00 2001 From: Zachary Wallace Date: Wed, 22 Jan 2025 14:56:23 -0800 Subject: [PATCH 1/5] Added matrix notification in Jenkinsfile --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index ea42d57..c76bcb9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,6 +60,11 @@ pipeline { status: currentBuild.result, targetUrl: "${siteUrl}", message: "Site available: ${siteUrl}" + + matrixSendMessage hostname: 'synapse.osuosl.org', + accessTokenCredentialsId: 'matrix-notification', + roomId: env.ROOM_ID + body: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} [Open](${env.BUILD_URL})" } } } From fca52ff8838dc7c2f40f18bd9e6b20b9b243b5ca Mon Sep 17 00:00:00 2001 From: Zachary Wallace Date: Mon, 27 Jan 2025 14:03:36 -0800 Subject: [PATCH 2/5] Added credentials for Jenkins --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c76bcb9..09eab46 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,7 +63,7 @@ pipeline { matrixSendMessage hostname: 'synapse.osuosl.org', accessTokenCredentialsId: 'matrix-notification', - roomId: env.ROOM_ID + roomId: credentials("matrix-room-id"), body: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} [Open](${env.BUILD_URL})" } } From 49706742390286c271ce716e8f6c38095b53d1a8 Mon Sep 17 00:00:00 2001 From: Zachary Wallace Date: Mon, 27 Jan 2025 14:11:00 -0800 Subject: [PATCH 3/5] Using withCredentials --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 09eab46..a8c6ed1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,10 +61,14 @@ pipeline { targetUrl: "${siteUrl}", message: "Site available: ${siteUrl}" - matrixSendMessage hostname: 'synapse.osuosl.org', - accessTokenCredentialsId: 'matrix-notification', - roomId: credentials("matrix-room-id"), - body: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} [Open](${env.BUILD_URL})" + withCredentials([string(credentialsId: 'matrix-room-id', variable: 'ROOM_ID')]){ + matrixSendMessage hostname: 'synapse.osuosl.org', + accessTokenCredentialsId: 'matrix-notification', + roomId: ROOM_ID, + body: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} [Open](${env.BUILD_URL})", + formattedBody: "

osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} | Open

", + type: "m.notify" + } } } } From e7702fb98f1e973a8293394147d6f6c76ac46694 Mon Sep 17 00:00:00 2001 From: Zachary Wallace Date: Wed, 29 Jan 2025 13:32:18 -0800 Subject: [PATCH 4/5] Formatted body on parity --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a8c6ed1..49b9130 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,8 +66,7 @@ pipeline { accessTokenCredentialsId: 'matrix-notification', roomId: ROOM_ID, body: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} [Open](${env.BUILD_URL})", - formattedBody: "

osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} | Open

", - type: "m.notify" + formattedBody: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} Open" } } } From d693c6e41e2c7b66fbd2ce53ef301c3154679e42 Mon Sep 17 00:00:00 2001 From: Zachary Wallace Date: Wed, 29 Jan 2025 14:25:16 -0800 Subject: [PATCH 5/5] Added staging site link --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 49b9130..83a28c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ pipeline { accessTokenCredentialsId: 'matrix-notification', roomId: ROOM_ID, body: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} [Open](${env.BUILD_URL})", - formattedBody: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result} Open" + formattedBody: "osuosl/website - #${env.BUILD_ID} finished with status ${currentBuild.result}
Open Jenkins Run
Open Staging Site" } } }