From 5e9030b122b73a6cdec087e3424ace923d57255d Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 4 Sep 2018 16:46:21 -0400 Subject: [PATCH] jenkins/cloud: Fix image genver logic We only want to go from `1` to `2` if we previously built the commit, not if there was a previous build. Also, we need to convert the genver into an integer before trying to add to it. --- Jenkinsfile.cloud | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.cloud b/Jenkinsfile.cloud index a27a38c9..370e2b3f 100644 --- a/Jenkinsfile.cloud +++ b/Jenkinsfile.cloud @@ -125,8 +125,8 @@ node(NODE) { // We write this to meta.json def meta = [:]; Integer image_genver; - if (last_build_meta != null) { - image_genver = last_build_meta["image-genver"] + 1; + if (previously_built_commit) { + image_genver = Integer.parseInt(last_build_meta["image-genver"]) + 1; } else { image_genver = 1; }