1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

[fix] sed'ing timestamp during mta build fails with blanks in file path.

This commit is contained in:
Marcus Holl 2017-11-13 09:26:34 +01:00
parent 47c195805f
commit 9d61638eb4
2 changed files with 6 additions and 6 deletions

View File

@ -85,7 +85,7 @@ public class MTABuildTest extends BasePipelineTest {
def mtarFilePath = script.execute()
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
assert shellCalls[0].endsWith('/mta.yaml')
assert shellCalls[0].endsWith('/mta.yaml"')
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
@ -109,7 +109,7 @@ public class MTABuildTest extends BasePipelineTest {
def mtarFilePath = script.execute()
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
assert shellCalls[0].endsWith('/mta.yaml')
assert shellCalls[0].endsWith('/mta.yaml"')
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
@ -135,7 +135,7 @@ public class MTABuildTest extends BasePipelineTest {
def mtarFilePath = script.execute(newDirName)
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
assert shellCalls[0].endsWith('/mta.yaml')
assert shellCalls[0].endsWith('/mta.yaml"')
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
@ -156,7 +156,7 @@ public class MTABuildTest extends BasePipelineTest {
def mtarFilePath = script.execute()
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
assert shellCalls[0].endsWith('/mta.yaml')
assert shellCalls[0].endsWith('/mta.yaml"')
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")
@ -178,7 +178,7 @@ public class MTABuildTest extends BasePipelineTest {
def mtarFilePath = script.execute()
assert shellCalls[0].startsWith('sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ')
assert shellCalls[0].endsWith('/mta.yaml')
assert shellCalls[0].endsWith('/mta.yaml"')
assert shellCalls[1].contains("PATH=./node_modules/.bin:/usr/bin")

View File

@ -20,7 +20,7 @@ def call(Map parameters = [:]) {
def mtaYaml = readYaml file: "${pwd()}/mta.yaml"
//[Q]: Why not yaml.dump()? [A]: This reformats the whole file.
sh "sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" ${pwd()}/mta.yaml"
sh "sed -ie \"s/\\\${timestamp}/`date +%Y%m%d%H%M%S`/g\" \"${pwd()}/mta.yaml\""
def id = mtaYaml.ID
if (!id) {