From cfdeea6230e3240e302358249226ced433d9d694 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Tue, 16 Aug 2016 13:15:14 -0700 Subject: [PATCH] [infra] writing vcs info into .rev file --- infra/libfuzzer-pipeline.groovy | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/infra/libfuzzer-pipeline.groovy b/infra/libfuzzer-pipeline.groovy index 89e5fa2a5..db8065e57 100644 --- a/infra/libfuzzer-pipeline.groovy +++ b/infra/libfuzzer-pipeline.groovy @@ -35,6 +35,7 @@ def call(body) { def date = java.time.format.DateTimeFormatter.ofPattern("yyyyMMddHHmm") .format(java.time.LocalDateTime.now()) + def ossFuzzUrl = 'https://github.com/google/oss-fuzz.git' node { echo "Building project $projectName with Dockerfile=$dockerfile" @@ -49,15 +50,21 @@ def call(body) { stage name: "Building $sanitizer sanitizer" def workspace = pwd(); def out = "$wsPwd/out/$sanitizer" + def revisions = [:] dir('oss-fuzz') { - git url: 'https://github.com/google/oss-fuzz.git' + git url: ossFuzzUrl } dir(checkoutDir) { git url: gitUrl + revisions[gitUrl] = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() } + def revText = groovy.json.JsonOutput.toJson(revs) + writeFile file: "$wsPwd/${sanitizer}.rev" text: revText + echo "revisions: $revText" + if (dockerContextDir == null) { dockerContextDir = new File(dockerfile) .getParentFile() @@ -94,8 +101,11 @@ def call(body) { def sanitizer = sanitizers[i] dir (sanitizer) { def zipFile = "$projectName-$sanitizer-${date}.zip" + def revFile = "$projectName-$sanitizer-${date}.rev" + sh "cp $wsPwd/${sanitizer}.rev $revFile" sh "zip -j $zipFile *" sh "gsutil cp $zipFile gs://clusterfuzz-builds/$projectName/" + sh "gsutil cp $revFile gs://clusterfuzz-builds/$projectName/" } } }