From 8aeb9a930b80659460d3e3b321c965957d5d2cb6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 13 Mar 2022 10:06:48 +0000 Subject: [PATCH] Debug sha/tags table --- product/info.groovy | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/product/info.groovy b/product/info.groovy index 5a1dfaf..3f55ed8 100644 --- a/product/info.groovy +++ b/product/info.groovy @@ -170,14 +170,28 @@ def parseproductrepo(LinkedHashMap productcollection, String productreleasefolder) { dir(productreleasefolder) { deleteDir() - sh """#!/bin/bash - git init - git config remote.origin.url ${productrepo} - git config advice.detachedHead false - git sparse-checkout init - git sparse-checkout set meta/* - git pull -t - """ + def returnstatus = sh(script: """#!/bin/bash + git init + if [ \$? -ne 0 ]; then exit 1; fi + git config remote.origin.url ${productrepo} + if [ \$? -ne 0 ]; then exit 1; fi + git config advice.detachedHead false + if [ \$? -ne 0 ]; then exit 1; fi + git sparse-checkout init + if [ \$? -ne 0 ]; then exit 1; fi + git sparse-checkout set meta/* + if [ \$? -ne 0 ]; then exit 1; fi + git pull -t + if [ \$? -ne 0 ]; then exit 1; fi + """, + returnStatus: true) + if (returnstatus > 0) { + dir('meta') { + deleteDir() + } + echo "Couldn't clone repository: ${productrepo} correctly" + return + } } def LinkedHashMap> shatagmap = gh.getremoteshatagmap(productrepo) def String productvariant @@ -185,10 +199,10 @@ def parseproductrepo(LinkedHashMap productcollection, shatagmap.each { sha, tags -> //echo "Sha: ${sha} has tags: ${tags}" dir(productreleasefolder) { - def returnstatus = sh( script: """#!/bin/bash - git checkout ${sha} - """, - returnStatus: true) + def returnstatus = sh(script: """#!/bin/bash + git checkout ${sha} + """, + returnStatus: true) if (returnstatus > 0) { dir('meta') { deleteDir()