diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-05-31 16:35:13 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-06-06 20:53:08 -0700 |
commit | c32a01f9ebae026c1b7b8ba081411581453b4624 (patch) | |
tree | c246e14bc178bfa1ea2ad6fe6487d80b528a31dc /releng/cli.py | |
parent | 611b1de441a54d3ed7781ca0a26b51b6cb9c45cc (diff) |
Put into place initial release engineering
This can release x86_64-linux binaries to staging, with ephemeral keys.
I think it's good enough to review at least at this point, so we don't
keep adding more stuff to it to make it harder to review.
Change-Id: Ie95e8f35d1252f5d014e819566f170b30eda152e
Diffstat (limited to 'releng/cli.py')
-rw-r--r-- | releng/cli.py | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/releng/cli.py b/releng/cli.py new file mode 100644 index 000000000..7db8a80f9 --- /dev/null +++ b/releng/cli.py @@ -0,0 +1,73 @@ +from . import create_release +import argparse +import sys + + +def do_build(args): + create_release.build_artifacts(no_check_git=args.no_check_git) + + +def do_tag(args): + create_release.do_tag_merge(force_tag=args.force_tag, + no_check_git=args.no_check_git) + + +def do_upload(args): + create_release.setup_creds() + create_release.upload_artifacts(force_push_tag=args.force_push_tag, + noconfirm=args.noconfirm) + +def do_prepare(args): + create_release.prepare_release_notes() + + +def main(): + ap = argparse.ArgumentParser(description='*Lix ur release engineering*') + + def fail(args): + ap.print_usage() + sys.exit(1) + + ap.set_defaults(cmd=fail) + + sps = ap.add_subparsers() + + prepare = sps.add_parser('prepare', help='Prepares for a release by moving the release notes over.') + prepare.set_defaults(cmd=do_prepare) + + tag = sps.add_parser( + 'tag', + help= + 'Create the tag for the current release in .version and merge it back to the current branch, then switch to it' + ) + tag.add_argument('--no-check-git', + action='store_true', + help="Don't check git state before tagging. For testing.") + tag.add_argument('--force-tag', + action='store_true', + help='Overwrite the existing tag. For testing.') + tag.set_defaults(cmd=do_tag) + + build = sps.add_parser( + 'release', + help= + 'Build an artifacts/ directory with the things that would be released') + build.add_argument( + '--no-check-git', + action='store_true', + help="Don't check git state before building. For testing.") + build.set_defaults(cmd=do_build) + + upload = sps.add_parser( + 'upload', help='Upload artifacts to cache and releases bucket') + upload.add_argument('--force-push-tag', + action='store_true', + help='Force push the tag. For testing.') + upload.add_argument( + '--noconfirm', + action='store_true', + help="Don't ask for confirmation. For testing/automation.") + upload.set_defaults(cmd=do_upload) + + args = ap.parse_args() + args.cmd(args) |