cazette/Jenkinsfile
William Petit 8e09f7ae3b
All checks were successful
kipp-news/pipeline/head This commit looks good
feat: initial commit
2025-01-19 21:04:20 +01:00

55 lines
1.1 KiB
Groovy

@Library("cadoles") _
pipeline {
agent {
dockerfile {
label 'docker'
filename 'Dockerfile'
dir 'misc/ci'
}
}
triggers {
cron('0 9 * * 1')
}
stages {
stage("Send newsletter") {
when {
anyOf {
triggeredBy cause: "UserIdCause", detail: "wpetit"
triggeredBy 'TimerTrigger'
}
}
steps {
script {
String newsletter = sh(script: "bash ./generate-newsletter.sh", returnStdout: true)
if (newsletter) {
rocketSend(
channel: '#TechWatch',
message: newsletter,
rawMessage: true
)
}
}
}
}
stage("Send test newsletter to wpetit") {
when {
branch 'master'
}
steps {
script {
String newsletter = sh(script: "bash ./generate-newsletter.sh", returnStdout: true)
if (newsletter) {
rocketSend(
channel: '@wpetit',
message: newsletter,
rawMessage: true
)
}
}
}
}
}
}