diff --git a/check_releasepy.bash b/check_releasepy.bash index 693b57727..921153017 100755 --- a/check_releasepy.bash +++ b/check_releasepy.bash @@ -25,6 +25,16 @@ exec_ignition_releasepy_test() ign-foo 1.2.3 token ${test_params}"" } +exec_ignition_gazebo_releasepy_test() +{ + test_params=${1} + + ./release.py \ + --dry-run \ + --no-sanity-checks \ + ign-gazebo 1.2.3 token ${test_params}"" +} + expect_job_run() { output="${1}" job="${2}" @@ -109,3 +119,12 @@ expect_number_of_jobs "${ignition_source_tarball_uri_test}" "7" expect_param "${ignition_source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fgz-foo-1.2.3.tar.gz" expect_param "${ignition_source_tarball_uri_test}" "PACKAGE=ign-foo" expect_param "${ignition_source_tarball_uri_test}" "PACKAGE_ALIAS=ignition-foo" + +ign_gazebo_source_tarball_uri_test=$(exec_ignition_gazebo_releasepy_test "--source-tarball-uri https://gazebosim/ign-gazebo-1.2.3.tar.gz") +expect_job_run "${ign_gazebo_source_tarball_uri_test}" "gz-sim-debbuilder" +expect_job_run "${ign_gazebo_source_tarball_uri_test}" "generic-release-homebrew_pull_request_updater" +expect_job_not_run "${ign_gazebo_source_tarball_uri_test}" "gz-sim-source" +expect_number_of_jobs "${ign_gazebo_source_tarball_uri_test}" "7" +expect_param "${ign_gazebo_source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fign-gazebo-1.2.3.tar.gz" +expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE=ign-gazebo" +expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE_ALIAS=ignition-gazebo" diff --git a/release.py b/release.py index ae947dbd9..265796308 100755 --- a/release.py +++ b/release.py @@ -31,22 +31,6 @@ IGNORE_DRY_RUN = True -GARDEN_IGN_PACKAGES = ['ign-cmake3', - 'ign-common5', - 'ign-fuel-tools8', - 'ign-sim7', - 'ign-gui7', - 'ign-launch6', - 'ign-math7', - 'ign-msgs9', - 'ign-physics6', - 'ign-plugin2', - 'ign-rendering7', - 'ign-sensors7', - 'ign-tools2', - 'ign-transport12', - 'ign-utils2'] - class ErrorNoPermsRepo(Exception): pass @@ -85,6 +69,12 @@ def get_canonical_package_name(pkg_name): return pkg_name.rstrip('1234567890') +def replace_ignition_gz(pkg_name): + return pkg_name \ + .replace('ignition-gazebo', 'gz-sim') \ + .replace('ignition-', 'gz-') + + def github_repo_exists(url): try: check_call(['git', 'ls-remote', '-q', '--exit-code', url], IGNORE_DRY_RUN) @@ -164,10 +154,6 @@ def parse_args(argv): args = parser.parse_args() - if args.package in GARDEN_IGN_PACKAGES: - print(f"Garden packages start with gz- prefix, changing {args.package} to {args.package.replace('ign-','gz-')}",) - args.package = args.package.replace('ign-', 'gz-') - args.package_alias = args.package if args.package.startswith('ign-'): args.package_alias = args.package.replace('ign-', 'ignition-') @@ -451,7 +437,7 @@ def generate_source_repository_uri(args): git_remote = out.decode().split('\n')[0] if org_repo not in git_remote: # Handle the special case for citadel ignition repositories - if org_repo.replace('/ignition-', '/gz-') not in git_remote: + if replace_ignition_gz(org_repo) not in git_remote: print(f""" !! Automatic calculation of the source repository URI\ failed with different information:\ \n * git remote origin in the local direcotry is: {git_remote}\ @@ -459,7 +445,7 @@ def generate_source_repository_uri(args): \n >> Please use --source-repo-uri parameter""") sys.exit(1) else: - org_repo = org_repo.replace('/ignition-', '/gz-') + org_repo = replace_ignition_gz(org_repo) print(' ~ Ignition found in generated org/repo assuming gz repo: ' + org_repo) @@ -536,7 +522,7 @@ def go(argv): if not args.release_version: args.release_version = 1 - package_alias_force_gz = args.package_alias.replace('ignition-','gz-') + package_alias_force_gz = replace_ignition_gz(args.package_alias) print(f"Downloading releasing info for {args.package}") # Sanity checks and dicover supported distributions before proceed.