@@ -10,7 +10,6 @@ def call(body) {
10
10
body()
11
11
12
12
def yaml
13
- def openShiftProject = config. openShiftProject
14
13
def openShiftTemplate = config. openShiftTemplate
15
14
def originalImageName = config. originalImageName
16
15
def newImageName = config. newImageName
@@ -20,22 +19,25 @@ def call(body) {
20
19
21
20
def flow = new io.fabric8.Fabric8Commands ()
22
21
def utils = new io.fabric8.Utils ()
22
+ def openShiftProject = config. openShiftProject + ' -' + utils. getRepoName()
23
23
24
- openShiftProject = openShiftProject + ' -' + utils. getRepoName()
25
24
container(' clients' ) {
26
25
if (! flow. isAuthorCollaborator(" " , project)){
27
26
currentBuild. result = ' ABORTED'
28
27
error ' Change author is not a collaborator on the project, aborting build until we support the [test] comment'
29
28
}
30
29
31
30
yaml = flow. getUrlAsString(openShiftTemplate)
32
- yaml = Pattern . compile(" - image: ${ originalImageName} :(.*)" ). matcher(yaml). replaceFirst(" - image: ${ newImageName} " )
31
+ def originalImage = " - image: ${ originalImageName} :(.*)"
32
+ def newImage = " - image: ${ newImageName} "
33
+ yaml = Pattern . compile(originalImage). matcher(yaml). replaceFirst(newImage)
33
34
34
- if (! yaml. contains(newImageName )){
35
- error " original image ${ originalImageName} not replaced with ${ newImageName } in yaml: \n ${ yaml} "
35
+ if (! yaml. contains(newImage )){
36
+ error " original image ${ originalImageName} not replaced with ${ newImage } in yaml: \n ${ yaml} "
36
37
}
37
38
}
38
- // cant use writeFile as we have long filename errors
39
+ // cant use writeFile as we are facing following error
40
+ // Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods
39
41
sh " echo '${ yaml} ' > snapshot.yml"
40
42
41
43
container(' clients' ) {
0 commit comments