[infra] don't use temp file

This commit is contained in:
Mike Aizatsky 2017-03-03 14:10:33 -08:00 committed by GitHub
parent efb4314494
commit e57093d37a
1 changed files with 3 additions and 3 deletions

View File

@ -71,10 +71,10 @@ def call(body) {
sh "docker build --no-cache -t $dockerTag -f checkout/$dockerfile checkout/$dockerContextDir"
// obtain srcmap
sh "docker run $dockerRunOptions --rm $dockerTag srcmap > $workspace/srcmap.json.tmp"
def srcmapJsonStr = sh(returnStdout: true,
script: "docker run $dockerRunOptions --rm $dockerTag srcmap").trim()
// use classic slurper: http://stackoverflow.com/questions/37864542/jenkins-pipeline-notserializableexception-groovy-json-internal-lazymap
def srcmap = new groovy.json.JsonSlurperClassic().parse(
new File("$workspace/srcmap.json.tmp"))
def srcmap = new groovy.json.JsonSlurperClassic().parse(srcmapJsonStr)
srcmap['/src'] = [ type: 'git',
rev: dockerfileRev,
url: dockerGit,