From a6c2db0eee6c1f78d776756e5d47a1d6b1b0f6ca Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Jun 30 2017 17:48:20 +0000 Subject: 2wkatomic: Generate a delta from the previous stable - Requires the repos be merged - Stop doing release substitution in the ref, since it changed for 26+ Resolves: https://pagure.io/releng/issue/6871 (Note, not tested) Signed-off-by: Colin Walters --- diff --git a/scripts/push-two-week-atomic.py b/scripts/push-two-week-atomic.py index 2310f0d..c6e477f 100755 --- a/scripts/push-two-week-atomic.py +++ b/scripts/push-two-week-atomic.py @@ -47,7 +47,8 @@ log = logging.getLogger(os.path.basename(sys.argv[0])) # Define "constants" ATOMIC_DIR = "/mnt/koji/mash/atomic/%s" -TARGET_REF = "fedora-atomic/%s/x86_64/docker-host" +PREVIOUS_TARGET_REF = "fedora-atomic/25/x86_64/docker-host" +TARGET_REF = "fedora/26/x86_64/atomic-host" COMPOSE_BASEDIR = "/mnt/koji/compose/twoweek/" MASHER_LOCKFILE_GLOB = "/mnt/koji/mash/updates/MASHING*" @@ -570,8 +571,17 @@ def move_tree_commit(release, old_commit, new_commit): log.error("move_tree_commit: diff generation failed: %s", diff_cmd) exit(3) + # Also generate a delta from the previous stable + diff_cmd = ["/usr/bin/sudo", "-u", "apache", + "ostree", "static-delta", "generate", "--repo", + ATOMIC_DIR % release, "--if-not-exists", "--from", PREVIOUS_TARGET_REF, + "--to", new_commit] + if subprocess.call(diff_cmd): + log.error("move_tree_commit: diff generation failed: %s", diff_cmd) + exit(3) + reset_cmd = ['/usr/bin/sudo', '-u', 'apache', - 'ostree', 'reset', TARGET_REF % release, + 'ostree', 'reset', TARGET_REF, new_commit, '--repo', ATOMIC_DIR % release] if subprocess.call(reset_cmd): log.error("move_tree_commit: resetting ref to new commit failed: %s", reset_cmd) @@ -672,7 +682,7 @@ if __name__ == '__main__': tree_version = tree_version.replace("'", "") rev_parse_cmd = ['/usr/bin/ostree', 'rev-parse', '--repo', - ATOMIC_DIR % pargs.release, TARGET_REF % pargs.release] + ATOMIC_DIR % pargs.release, TARGET_REF] previous_commit = subprocess.check_output(rev_parse_cmd).strip() # This could happen if there was a failure in this script sending the email