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..8589a6122 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() ) } @@ -136,7 +139,7 @@ class OSRFSourceCreation trigger(releasepy_jobname) { parameters { currentBuild() - predefinedProps([PROJECT_NAME_TO_COPY_ARTIFACTS: "\${JOB_NAME}"]) + predefinedProps([PROJECT_NAME_TO_COPY_ARTIFACTS: "\${JOB_NAME}"],) propertiesFile(properties_file) // TARBALL_NAME } }