Skip to content

Commit

Permalink
Allow ddev release to commit directly to master for extras integratio…
Browse files Browse the repository at this point in the history
…ns (#7127)

* Allow ddev release to commit directly to master for extras integratino

* Update datadog_checks_dev/datadog_checks/dev/tooling/commands/release/make.py

* Update datadog_checks_dev/datadog_checks/dev/tooling/commands/release/make.py

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
  • Loading branch information
FlorianVeaux and ofek authored Jul 14, 2020
1 parent b52d716 commit cb0251b
Showing 1 changed file with 5 additions and 5 deletions.
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,9 @@ def make(ctx, checks, version, initial_release, skip_sign, sign_only, exclude):
repo_choice = ctx.obj['repo_choice']
core_workflow = repo_choice == 'core'

if get_current_branch() == 'master' and (core_workflow or not allow_master):
abort('Please create a release branch, you do not want to commit to master directly.')

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

0 comments on commit cb0251b

Please sign in to comment.