testing slack notif

This commit is contained in:
Jack-Leung 2020-03-15 23:43:53 -04:00 committed by GitHub
parent 08e6477f96
commit a81b521880
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

25
Jenkinsfile vendored
View file

@ -1,23 +1,16 @@
node { node {
try { try {
notifyBuild('STARTED') notifySlack('STARTED')
stage('Prepare code') { pipeline {
echo 'do checkout stuff' agent any
stages {
stage('Build') {
steps {
echo 'Build'
} }
stage('Testing') {
echo 'Testing'
echo 'Testing - publish coverage results'
} }
stage('Staging') {
echo 'Deploy Stage'
} }
stage('Deploy') {
echo 'Deploy - Backend'
echo 'Deploy - Frontend'
} }
} catch (e) { } catch (e) {
@ -26,11 +19,11 @@ node {
throw e throw e
} finally { } finally {
// Success or failure, always send notifications // Success or failure, always send notifications
notifyBuild(currentBuild.result) notifySlack(currentBuild.result)
} }
} }
def notifyBuild(String buildStatus = 'STARTED') { def notifySlack(String buildStatus = 'STARTED') {
// build status of null means successful // build status of null means successful
buildStatus = buildStatus ?: 'SUCCESSFUL' buildStatus = buildStatus ?: 'SUCCESSFUL'