This commit is contained in:
37
Jenkinsfile
vendored
37
Jenkinsfile
vendored
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user