diff --git a/Jenkinsfile b/Jenkinsfile index 41c11c77..61a96b6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -82,21 +82,19 @@ pipeline { image.push(env.DOCKER_TAG) } } } - post { - always { script { - if (params.DISCORD_WEBHOOK_CRED) { - def result = currentBuild.result.toLowerCase() ?: 'unknown' - discordNotify( - header: "SpiffWorkflow Docker image build ${result}!", - cred: params.DISCORD_WEBHOOK_CRED, - ) - } - } } - } } } // stages post { - always { sh 'docker image prune -f' } + always { script { + sh 'docker image prune -f' } + if (params.DISCORD_WEBHOOK_CRED) { + def result = currentBuild.result.toLowerCase() ?: 'unknown' + discordNotify( + header: "SpiffWorkflow Docker image build ${result}!", + cred: params.DISCORD_WEBHOOK_CRED, + ) + } + } } cleanup { cleanWs() } } // post } // pipeline