From: Anil Belur Date: Fri, 29 Jun 2018 12:16:57 +0000 (+1000) Subject: Add user-specified download path for lftools sign X-Git-Tag: v0.14.0~7^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=e51dc8a8bee8511d333be967b82fc21cfe680651;p=releng%2Flftools.git Add user-specified download path for lftools sign Add a user-specified download location for lftools sign deploy-nexus command. The default download location is "/tmp/gpg-signatures.*" where '*' is random generated suffix added to a directory name returned by mkdtemp() Projects like ODL require more than 5 GiB free space which might not be available in the returned path therefore we should allow the user to use an alternative download path. ex: lftools sign deploy-nexus -d JIRA: RELENG-928 Change-Id: I960e6c2dd5b5311ec0551834c6b96a297a2eb8bd Signed-off-by: Anil Belur --- diff --git a/lftools/cli/sign.py b/lftools/cli/sign.py index e93a70fe..abb50381 100644 --- a/lftools/cli/sign.py +++ b/lftools/cli/sign.py @@ -48,11 +48,15 @@ def nexus(ctx, nexus_repo_url): @click.argument('nexus-url', envvar='NEXUS_URL') @click.argument('nexus-repo', envvar='NEXUS_REPO') @click.argument('staging-profile-id', envvar='STAGING_PROFILE_ID') +@click.option( + '-d', '--sign-dir', type=str, + default=tempfile.mkdtemp(prefix='gpg-signatures.'), + help='Local directory to clone repository. (default /tmp/gpg-signatures.*)') @click.option( '-r', '--root-domain', type=str, default='org', help='Root download path of staging repo. (default org)') @click.pass_context -def deploy_nexus(ctx, nexus_url, nexus_repo, staging_profile_id, root_domain): +def deploy_nexus(ctx, nexus_url, nexus_repo, staging_profile_id, sign_dir, root_domain): """Sign artifacts from a Nexus repo then upload to a staging repo. This is a porcelain command that ties the lftools sign and deploy tools @@ -65,7 +69,6 @@ def deploy_nexus(ctx, nexus_url, nexus_repo, staging_profile_id, root_domain): # -r option. nexus_url = nexus_url.rstrip('/') nexus_repo_url = "{}/content/repositories/{}/{}".format(nexus_url, nexus_repo, root_domain) - sign_dir = tempfile.mkdtemp(prefix='gpg-signatures.') status = subprocess.call(['sign', 'nexus', '-d', sign_dir, nexus_repo_url]) if status: