@@ -2,13 +2,23 @@ def run(params) {
2
2
timestamps {
3
3
// Retrieve the hash commit of the last product built in OBS/IBS and previous job
4
4
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
+ }
12
22
}
13
23
// Start pipeline
14
24
deployed = false
@@ -39,7 +49,9 @@ def run(params) {
39
49
deployed = true
40
50
}
41
51
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
+ }
43
55
}
44
56
stage(' Sanity Check' ) {
45
57
sh " ./terracumber-cli ${ common_params} --logfile ${ resultdirbuild} /testsuite.log --runstep cucumber --cucumber-cmd 'cd /root/spacewalk/testsuite; rake cucumber:sanity_check'"
0 commit comments