@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 ) } } } } } }