Skip to content

Commit

Permalink
Added Global support to handle S3 paths
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 Sep 7, 2023
1 parent 829dcf6 commit ba15e4e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions jenkins-scripts/dsl/_configs_/Globals.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,28 @@ class Globals
static String nontest_label(String original_label) {
return "(${original_label}) && !test-instance"
}

static String get_canonical_package_name(String package_name) {
return package_name.replaceAll('\\d*$', '')
}

static String _s3_releases_dir(String package_name) {
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)
}
}

0 comments on commit ba15e4e

Please sign in to comment.