From a5207c8da28ab0642df656a70ecdb2eb94094d1e Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 4 Oct 2023 17:49:30 +0200 Subject: [PATCH] Implement the SOURCE_TARBALL_URI in OSRFSourceCreation Signed-off-by: Jose Luis Rivero --- jenkins-scripts/dsl/_configs_/Globals.groovy | 15 +++++---------- .../dsl/_configs_/OSRFSourceCreation.groovy | 3 +++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/jenkins-scripts/dsl/_configs_/Globals.groovy b/jenkins-scripts/dsl/_configs_/Globals.groovy index 2adc32511..bb4e41bae 100644 --- a/jenkins-scripts/dsl/_configs_/Globals.groovy +++ b/jenkins-scripts/dsl/_configs_/Globals.groovy @@ -140,19 +140,14 @@ class Globals return get_canonical_package_name(package_name) + '/releases' } - static String _s3_build_tarball_name(String package_name, String version) { - // canonical_name + version - return package_name.replaceAll('\\d*$', '') + '-' + version - } - static String s3_upload_tarball_path(String package_name) { return 's3://osrf-distributions/' + _s3_releases_dir(package_name) } - // Not yet in use. Requires changing release.py - static String s3_download_uri(String package_name, String version) { - return 'https://osrf-distributions.s3.amazonaws.com/' + \ - _s3_releases_dir(package_name) + \ - _s3_build_tarball_name(package_name, version) + static String s3_download_url_basedir(String package_name) { + return 'https://osrf-distributions.s3.amazonaws.com/' + _s3_releases_dir(package_name) } + + /* rest of the s3 paths need to be cumputed during job running time since + * they depend on VERSION and it is not avialble at DSL time */ } diff --git a/jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy b/jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy index 03ec85035..63463b9ff 100644 --- a/jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy +++ b/jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy @@ -60,6 +60,8 @@ class OSRFSourceCreation def canonical_package_name = Globals.get_canonical_package_name( default_params.find{ it.key == "PACKAGE"}.value) + def s3_download_url_basedir = Globals.s3_download_url_basedir( + default_params.find{ it.key == "PACKAGE"}?.value) steps { systemGroovyCommand("""\ @@ -98,6 +100,7 @@ class OSRFSourceCreation fi echo "TARBALL_NAME=\${tarball}" >> ${properties_file} + echo "SOURCE_TARBALL_URI=$s3_download_url_basedir/\${tarball}" >> ${properties_file} """.stripIndent() ) }