From 968fecdb8f77634e29c5bbbad6c7e6641ade25c3 Mon Sep 17 00:00:00 2001 From: William Petit Date: Sun, 15 Jun 2025 23:50:32 +0200 Subject: [PATCH] feat: initial commit --- Jenkinsfile | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cd269b2..f16d29c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,18 +29,33 @@ pipeline { } steps { script { - String callToAction = sh(script: "curl https://kouiz.dev.lookingfora.name/api/presentation/turn", returnStdout: true) - if (callToAction) { - rocketSend( - channel: '#le-kouiz', - message: """ - ${callToAction} - - > [Répondre à la question du jour](https://kouiz.dev.lookingfora.name/) < - """.stripIndent(), - rawMessage: true - ) + def currentTime = new Date() + def hour = currentTime.hours + def isMorning = hour < 12 + + if (isMorning) { + String callToAction = sh(script: "curl https://kouiz.dev.lookingfora.name/api/presentation/turn", returnStdout: true) + if (callToAction) { + rocketSend( + avatar: "https://kouiz.dev.lookingfora.name/assets/panda.png", + channel: '#le-kouiz', + message: """ + ${callToAction} + + > [Répondre à la question du jour](https://kouiz.dev.lookingfora.name/) < + """.stripIndent(), + rawMessage: true, + attachements: [ + authorIcon: "https://kouiz.dev.lookingfora.name/assets/panda.png", + authorName: "Panda Kouiz" + ] + ) + } + } else { + } + + } } }