This commit is contained in:
35
Jenkinsfile
vendored
35
Jenkinsfile
vendored
@ -29,18 +29,33 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
String callToAction = sh(script: "curl https://kouiz.dev.lookingfora.name/api/presentation/turn", returnStdout: true)
|
def currentTime = new Date()
|
||||||
if (callToAction) {
|
def hour = currentTime.hours
|
||||||
rocketSend(
|
def isMorning = hour < 12
|
||||||
channel: '#le-kouiz',
|
|
||||||
message: """
|
if (isMorning) {
|
||||||
${callToAction}
|
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 {
|
||||||
|
|
||||||
> [Répondre à la question du jour](https://kouiz.dev.lookingfora.name/) <
|
|
||||||
""".stripIndent(),
|
|
||||||
rawMessage: true
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user