From 03c879b0732c00d172374160319b7db900836770 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Thu, 6 Feb 2020 12:10:32 +0100 Subject: [PATCH] [no publish] do not increment version if build failed --- jenkins.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jenkins.js b/jenkins.js index ed29440..54162a9 100644 --- a/jenkins.js +++ b/jenkins.js @@ -1,3 +1,4 @@ +/* eslint-disable no-process-exit */ /* eslint-disable no-console */ /* eslint-disable no-sync */ 'use strict'; @@ -16,8 +17,10 @@ child_process.execSync ('yarn test', { stdio: 'inherit' }); child_process.exec ('git log -1 | grep \'\\[no publish\\]\'') .addListener ('exit', (code) => { - if (code === 0) + if (code === 0) { console.log ('build not marked for deployment'); + process.exit (1); + } else child_process.execSync ('yarn publish'); });