From f8039d40ed6546ae8062d07296bc7ffc33a44cc5 Mon Sep 17 00:00:00 2001 From: ghorsington Date: Wed, 2 Oct 2019 22:56:03 +0300 Subject: [PATCH] Replace null checks in CI with string checks --- scripts/jenkins_master.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/jenkins_master.groovy b/scripts/jenkins_master.groovy index dcd4abf..e66cb57 100644 --- a/scripts/jenkins_master.groovy +++ b/scripts/jenkins_master.groovy @@ -11,10 +11,10 @@ pipeline { stage('Pull Projects') { steps { script { - if(fileExists('last_build_commit')) + if(fileExists('./last_build_commit')) lastBuildCommit = readFile 'last_build_commit' else - lastBuildCommit = null + lastBuildCommit = "" echo(lastBuildCommit) } // Clean up old project before starting @@ -44,7 +44,7 @@ Changes since ${latestTag}: {{/merge}} {{/commits}}""", to: [type: 'COMMIT', value: "${longCommit}"] - if(lastBuildCommit != null) { + if(lastBuildCommit != "") { htmlChangelog = gitChangelog from: [type: 'COMMIT', value: lastBuildCommit], returnType: 'STRING', template: """""", to: [type: 'COMMIT', value: "${longCommit}"] } else @@ -163,8 +163,7 @@ Changes since ${latestTag}: post { cleanup { script { - if(params.IS_BE) - writeFile file: 'last_build_commit', text: lastBuildCommit + writeFile file: 'last_build_commit', text: lastBuildCommit } } success {