From fb494e5e3045d16c0591d89af9ba9b3a6b0beb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 9 May 2023 17:31:54 +0200 Subject: [PATCH] ci: create version_info.json file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Will be used for exporting version metrics. Signed-off-by: Jakub SokoĊ‚owski --- Jenkinsfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 268239fe9..cc4df5456 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +import groovy.json.JsonBuilder + pipeline { agent { label 'linux' } @@ -45,6 +47,17 @@ pipeline { } stages { + stage('Prep') { + steps { script { + def jobMetaJson = new JsonBuilder([ + git_commit: env.GIT_COMMIT.take(7), + git_branch: env.GIT_BRANCH, + build_id: env.BUILD_ID, + ]).toPrettyString() + sh "echo '${jobMetaJson}' > version_info.json" + } } + } + stage('Build') { steps { script { dir("spiffworkflow-${params.COMPONENT}") {