From cfb812d8f1ea857798a28d07a9c1fa772e5c54bd Mon Sep 17 00:00:00 2001 From: Jack-Leung <38930117+Jack-Leung@users.noreply.github.com> Date: Sun, 15 Mar 2020 23:56:29 -0400 Subject: [PATCH] testing 2 --- Jenkinsfile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7d024c0b7..2350b1222 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,29 +1,29 @@ -node { - try { - notifySlack('STARTED') +pipeline { + agent any + node { + try { + notifyBuild('STARTED') - pipeline { - agent any stages { stage('Build') { steps { - echo 'Build' + echo 'build' } } } + + } catch (e) { + // If there was an exception thrown, the build failed + currentBuild.result = "FAILED" + throw e + } finally { + // Success or failure, always send notifications + notifyBuild(currentBuild.result) } - - } catch (e) { - // If there was an exception thrown, the build failed - currentBuild.result = "FAILED" - throw e - } finally { - // Success or failure, always send notifications - notifySlack(currentBuild.result) - } + } } -def notifySlack(String buildStatus = 'STARTED') { +def notifyBuild(String buildStatus = 'STARTED') { // build status of null means successful buildStatus = buildStatus ?: 'SUCCESSFUL'