From f16e377911f285e85cb856a98e4a35d8dadc0fa0 Mon Sep 17 00:00:00 2001 From: Benjamin Bohard Date: Tue, 8 Feb 2022 09:18:19 +0100 Subject: [PATCH] =?UTF-8?q?Suppression=20de=20la=20boucle=20et=20du=20d?= =?UTF-8?q?=C3=A9coupage=20de=20la=20sortie=20standard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vars/tamarin.groovy | 47 +++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/vars/tamarin.groovy b/vars/tamarin.groovy index a572721..24d5cc5 100644 --- a/vars/tamarin.groovy +++ b/vars/tamarin.groovy @@ -10,37 +10,34 @@ def buildPackageWithCPKG( def result = [:] // Retrieve commit tags - def commitTags = sh(script: 'git describe --exact-match --abbrev=0', returnStdout: true).split(' ') - if (commitTags.length == 0) { + def commitTag = sh(script: 'git describe --exact-match --abbrev=0', returnStdout: true) + if (commitTag == '') { error 'No build build tags on last commit' } - // For each tags - for (tag in commitTags) { + // Split tag to retrieve context informations + def tagParts = commitTag.split('/') + def packageEnv = tagParts[1] + def packageDistrib = tagParts[2] + def packageVersion = tagParts[3] - // Split tag to retrieve context informations - def tagParts = tag.split('/') - def packageEnv = tagParts[1] - def packageDistrib = tagParts[2] - def packageVersion = tagParts[3] + // Create .tamarinrc file + def tamarinrc = """ + project_version=${packageVersion} + no_version_suffix=${ packageEnv == 'stable' || packageEnv == 'staging' ? 'yes' : 'no' } + """.stripIndent() + writeFile file: '.tamarinrc', text: tamarinrc - // Create .tamarinrc file - def tamarinrc = """ - project_version=${packageVersion} - no_version_suffix=${ packageEnv == 'stable' || packageEnv == 'staging' ? 'yes' : 'no' } - """.stripIndent() - writeFile file: '.tamarinrc', text: tamarinrc - - sh "rm -rf ${destDir}/*" + sh "rm -rf ${destDir}/*" - stage("Build ${packageEnv} package (version ${packageVersion}) for ${packageDistrib}") { - result.put('tag', tag) - result.put('env', packageEnv) - result.put('version', packageVersion) - result.put('distrib', packageDistrib) - def packages = buildPackage(packageProfile, packageArch, baseImage, destDir, forceRebuild) - result.put('packages', packages) - } + stage("Build ${packageEnv} package (version ${packageVersion}) for ${packageDistrib}") { + result.put('tag', commitTag) + result.put('env', packageEnv) + result.put('version', packageVersion) + result.put('distrib', packageDistrib) + def packages = buildPackage(packageProfile, packageArch, baseImage, destDir, forceRebuild) + result.put('packages', packages) + } }