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 ddev release to commit directly to master for extras integrations #7127

Merged
merged 3 commits into from
Jul 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
@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.option('--exclude', help='Comma-separated list of checks to skip')
@click.option('--allow-master', is_flag=True, help='Allow ddev to commit directly to master. Forbidden for core.')
@click.pass_context
def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude):
def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude, allow_master):
"""Perform a set of operations needed to release checks:

\b
Expand Down Expand Up @@ -52,10 +53,6 @@ def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude):
if check not in valid_checks:
abort(f'Check `{check}` is not an Agent-based Integration')

# don't run the task on the master branch
if get_current_branch() == 'master':
abort('Please create a release branch, you do not want to commit to master directly.')

if releasing_all:
if version:
abort('You cannot bump every check to the same version')
Expand All @@ -74,6 +71,12 @@ def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude):
repo_choice = ctx.obj['repo_choice']
core_workflow = repo_choice == 'core'

# don't run the task on the master branch
FlorianVeaux marked this conversation as resolved.
Show resolved Hide resolved
if get_current_branch() == 'master':
# This is potentially unsafe, abort if not explicit
if core_workflow or not allow_master:
abort('Please create a release branch, you do not want to commit to master directly.')
FlorianVeaux marked this conversation as resolved.
Show resolved Hide resolved

# Signing is done by a pipeline in a separate commit
if not core_workflow and not sign_only:
skip_sign = True
Expand Down