Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow releasing multiple checks at once #3881

Merged
merged 1 commit into from Jun 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -553,15 +553,15 @@ def tag(check, version, push, dry_run):
abort(code=2)


@release.command(context_settings=CONTEXT_SETTINGS, short_help='Release a single check')
@click.argument('check')
@click.argument('version', required=False)
@release.command(context_settings=CONTEXT_SETTINGS, short_help='Release one or more checks')
@click.argument('checks', nargs=-1, required=True)
@click.option('--version')
@click.option('--new', 'initial_release', is_flag=True, help='Ensure versions are at 1.0.0')
@click.option('--skip-sign', is_flag=True, help='Skip the signing of release metadata')
@click.option('--sign-only', is_flag=True, help='Only sign release metadata')
@click.pass_context
def make(ctx, check, version, initial_release, skip_sign, sign_only):
"""Perform a set of operations needed to release a single check:
def make(ctx, checks, version, initial_release, skip_sign, sign_only):
"""Perform a set of operations needed to release checks:

\b
* update the version in __about__.py
Expand All @@ -580,11 +580,13 @@ def make(ctx, check, version, initial_release, skip_sign, sign_only):
# Import lazily since in-toto runs a subprocess to check for gpg2 on load
from ..signing import update_link_metadata, YubikeyException

releasing_all = check == 'all'
releasing_all = 'all' in checks

valid_checks = get_valid_checks()
if not releasing_all and check not in valid_checks:
abort('Check `{}` is not an Agent-based Integration'.format(check))
if not releasing_all:
for check in checks:
if check not in valid_checks:
abort('Check `{}` is not an Agent-based Integration'.format(check))

# don't run the task on the master branch
if get_current_branch() == 'master':
Expand All @@ -595,7 +597,7 @@ def make(ctx, check, version, initial_release, skip_sign, sign_only):
abort('You cannot bump every check to the same version')
checks = sorted(valid_checks)
else:
checks = [check]
checks = sorted(checks)

if initial_release:
version = '1.0.0'
Expand Down