@@ -2,13 +2,23 @@ def run(params) {
22 timestamps {
33 // Retrieve the hash commit of the last product built in OBS/IBS and previous job
44 def prefix = env. JOB_BASE_NAME . split(' -cucumber' )[0 ]
5- def request = httpRequest " https://ci.suse.de/job/${ prefix} -2obs/lastBuild/api/json"
6- def requestJson = readJSON text : request. getContent()
7- def product_commit = requestJson. actions. lastBuiltRevision. SHA1 . replaceAll(" \\ [|\\ ]" , " " )
8- def previous_commit = currentBuild. getPreviousBuild(). displayName
9- // Rename build using product commit hash
10- node {
11- currentBuild. displayName = " ${ product_commit} "
5+ if (prefix. contains(" manager" )) {
6+ def request = httpRequest " https://ci.suse.de/job/${ prefix} -2obs/lastBuild/api/json"
7+ def requestJson = readJSON text : request. getContent()
8+ def product_commit = " ${ requestJson.actions.lastBuiltRevision.SHA1} "
9+ product_commit = product_commit. substring(product_commit. indexOf(' [' ) + 1 , product_commit. indexOf(' ]' ));
10+ print " Current product commit: ${ product_commit} "
11+ def previous_commit = currentBuild. getPreviousBuild(). description
12+ if (previous_commit == null ) {
13+ previous_commit = product_commit
14+ } else {
15+ previous_commit = previous_commit. substring(previous_commit. indexOf(' [' ) + 1 , previous_commit. indexOf(' ]' ));
16+ }
17+ print " Previous product commit: ${ previous_commit} "
18+ // Rename build using product commit hash
19+ node {
20+ currentBuild. description = " [${ product_commit} ]"
21+ }
1222 }
1323 // Start pipeline
1424 deployed = false
@@ -39,7 +49,9 @@ def run(params) {
3949 deployed = true
4050 }
4151 stage(' Product changes' ) {
42- sh script :" ./terracumber-cli ${ common_params} --logfile ${ resultdirbuild} /testsuite.log --runstep cucumber --cucumber-cmd 'cd /root/spacewalk/; git rev-list --pretty=oneline ${ previous_commit} ..${ product_commit} '" , returnStatus :true
52+ if (prefix. contains(" manager" )) {
53+ sh script :" ./terracumber-cli ${ common_params} --logfile ${ resultdirbuild} /testsuite.log --runstep cucumber --cucumber-cmd 'cd /root/spacewalk/; git rev-list --pretty=oneline ${ previous_commit} ..${ product_commit} '" , returnStatus :true
54+ }
4355 }
4456 stage(' Sanity Check' ) {
4557 sh " ./terracumber-cli ${ common_params} --logfile ${ resultdirbuild} /testsuite.log --runstep cucumber --cucumber-cmd 'cd /root/spacewalk/testsuite; rake cucumber:sanity_check'"
0 commit comments