Files
kouiz/Jenkinsfile

48 lines
1.0 KiB
Plaintext
Raw Normal View History

2025-06-15 23:33:18 +02:00
@Library("cadoles") _
pipeline {
agent {
dockerfile {
label 'docker'
filename 'Dockerfile'
dir 'misc/ci'
}
}
triggers {
2025-06-15 23:39:51 +02:00
cron('0 10 * * 1-5 \n 0 16 * * 1-5')
2025-06-15 23:33:18 +02:00
}
parameters {
booleanParam(name: 'FORCE_SEND', defaultValue: false, description: 'Force send of message')
}
stages {
stage("Send call to action") {
when {
allOf {
anyOf {
triggeredBy 'TimerTrigger'
expression { params.FORCE_SEND == true }
}
}
}
steps {
script {
String callToAction = sh(script: "curl https://kouiz.dev.lookingfora.name/api/presentation/turn", returnStdout: true)
if (callToAction) {
rocketSend(
channel: '#le-kouiz',
2025-06-15 23:44:41 +02:00
message: """
${callToAction}
> [Répondre à la question du jour](https://kouiz.dev.lookingfora.name/) <
""".stripIndent(),
2025-06-15 23:33:18 +02:00
rawMessage: true
)
}
}
}
}
}
}