Skip to content

Commit

Permalink
Implement the SOURCE_TARBALL_URI in OSRFSourceCreation
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Oct 4, 2023
1 parent 8bd6527 commit a5207c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
15 changes: 5 additions & 10 deletions jenkins-scripts/dsl/_configs_/Globals.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
3 changes: 3 additions & 0 deletions jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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("""\
Expand Down Expand Up @@ -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()
)
}
Expand Down

0 comments on commit a5207c8

Please sign in to comment.