aboutsummaryrefslogtreecommitdiff
path: root/releng/cli.py
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-06-06 22:28:49 -0700
committerJade Lovelace <lix@jade.fyi>2024-06-09 00:30:12 -0700
commitff95b980d4913e90bc334227f8f3f7b3daf18b36 (patch)
tree08799eda970630ea1cc59142698fa99068db8fc6 /releng/cli.py
parent98e847514795f53f485b6dbd029ecb545ce38236 (diff)
Implement docker upload in the releng tools
This uses skopeo to not think about docker daemons. I, however, noticed that the docker image we had would have totally terrible cache hits, so I rewrote it. Fixes: https://git.lix.systems/lix-project/lix/issues/252 Change-Id: I3c5b6c1f3ba0b9dfcac212b2148f390e0cd542b7
Diffstat (limited to 'releng/cli.py')
-rw-r--r--releng/cli.py28
1 files changed, 22 insertions, 6 deletions
diff --git a/releng/cli.py b/releng/cli.py
index bba50f534..89391e0a7 100644
--- a/releng/cli.py
+++ b/releng/cli.py
@@ -1,4 +1,8 @@
from . import create_release
+from . import docker
+from .environment import RelengEnvironment
+from . import environment
+import functools
import argparse
import sys
@@ -18,13 +22,16 @@ def do_tag(args):
no_check_git=args.no_check_git)
-def do_upload(args):
- create_release.setup_creds()
+def do_upload(env: RelengEnvironment, args):
+ create_release.setup_creds(env)
if args.target == 'all':
- create_release.upload_artifacts(force_push_tag=args.force_push_tag,
- noconfirm=args.noconfirm)
+ docker.check_all_logins(env)
+ create_release.upload_artifacts(env,
+ force_push_tag=args.force_push_tag,
+ noconfirm=args.noconfirm,
+ no_check_git=args.no_check_git)
elif args.target == 'manual':
- create_release.upload_manual()
+ create_release.upload_manual(env)
else:
raise ValueError('invalid target, unreachable')
@@ -77,6 +84,10 @@ def main():
upload = sps.add_parser(
'upload', help='Upload artifacts to cache and releases bucket')
+ upload.add_argument(
+ '--no-check-git',
+ action='store_true',
+ help="Don't check git state before uploading. For testing.")
upload.add_argument('--force-push-tag',
action='store_true',
help='Force push the tag. For testing.')
@@ -90,7 +101,12 @@ def main():
'--noconfirm',
action='store_true',
help="Don't ask for confirmation. For testing/automation.")
- upload.set_defaults(cmd=do_upload)
+ upload.add_argument('--environment',
+ choices=list(environment.ENVIRONMENTS.keys()),
+ default='staging',
+ help='Environment to release to')
+ upload.set_defaults(cmd=lambda args: do_upload(
+ environment.ENVIRONMENTS[args.environment], args))
args = ap.parse_args()
args.cmd(args)