From: Bengt Thuree Date: Thu, 29 Nov 2018 11:22:38 +0000 (+1100) Subject: Connect cli to release_docker_hub 7(7). X-Git-Tag: v0.22.1~1^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F34%2F13734%2F10;p=releng%2Flftools.git Connect cli to release_docker_hub 7(7). This is the seventh, and final part, which adds the cli part. Issue:RELENG-1549 Change-Id: I629d575730abd73425dacd5e694a30cadcd85657 Signed-off-by: Bengt Thuree --- diff --git a/lftools/cli/nexus.py b/lftools/cli/nexus.py index a1d928a2..f4bde7cc 100644 --- a/lftools/cli/nexus.py +++ b/lftools/cli/nexus.py @@ -13,6 +13,7 @@ from os import environ import click from lftools.nexus import cmd as nexuscmd +import lftools.nexus.release_docker_hub as rdh NEXUS_URL_ENV = 'NEXUS_URL' @@ -131,3 +132,33 @@ def release(ctx, repos, server): if not server and NEXUS_URL_ENV in environ: server = environ[NEXUS_URL_ENV] nexuscmd.release_staging_repos(repos, server) + + +@docker.command(name="releasedockerhub") +@click.option( + '-o', '--org', type=str, required=True, + help='Specify repository organization.') +@click.option( + '-r', '--repo', type=str, default='', required=False, + help='Only repos containing this string will be selected. ' + 'Default set to blank string, which is every repo.') +@click.option( + '-s', '--summary', is_flag=True, required=False, + help='Prints a summary of missing docker tags.') +@click.option( + '-v', '--verbose', is_flag=True, required=False, + help='Prints all collected repo/tag information.') +@click.option( + '-c', '--copy', is_flag=True, required=False, + help='Copy missing tags from Nexus3 repos to Docker Hub repos.') +@click.option( + '-p', '--progbar', is_flag=True, required=False, default=False, + help='Display a progress bar for the time consuming jobs.') +@click.pass_context +def copy_from_nexus3_to_dockerhub(ctx, org, repo, summary, verbose, copy, progbar): + """Find missing repos in Docker Hub, Copy from Nexus3. + + Will by default list all missing repos in Docker Hub, compared to Nexus3. + If -c (--copy) is provided, it will copy the repos from Nexus3 to Docker Hub. + """ + rdh.start_point(org, repo, summary, verbose, copy, progbar)