Skip to content
Snippets Groups Projects
Commit d48b6a14 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[scripts] Be more flexible with group discovery

parent 08dcdedf
No related branches found
No related tags found
No related merge requests found
Pipeline #57065 passed
......@@ -120,6 +120,12 @@ Examples:
)
@click.argument("name")
@click.argument("targets", nargs=-1, required=True)
@click.option(
"-g",
"--group/--no-group",
default=False,
help="If set, consider the the provided name as a group name",
)
@click.option(
"-d",
"--dry-run/--no-dry-run",
......@@ -130,7 +136,7 @@ Examples:
)
@verbosity_option()
@bdt.raise_on_error
def enable(name, targets, dry_run):
def enable(name, targets, group, dry_run):
"""Enables runners on whole gitlab groups or single projects.
You may provide project names (like "group/project"), whole groups, and
......@@ -145,12 +151,12 @@ def enable(name, targets, dry_run):
packages = []
for target in targets:
if "/" in target: # it is a specific project
packages.append(_get_project(gl, target))
elif os.path.exists(target): # it is a file with project names
if os.path.exists(target): # it is a file with project names
packages += _get_projects_from_file(gl, target)
elif not group: # it is a specific project
packages.append(_get_project(gl, target))
else: # it is a group - get all projects
packages += _get_projects_from_group(gl, target)
......
......@@ -114,7 +114,7 @@ def settings(projects, avatar, description, group, archive, dry_run):
if os.path.exists(target): # it is a file with project names
gl_projects += _get_projects_from_file(gl, target)
if not group: # it is a specific project
elif not group: # it is a specific project
gl_projects.append(_get_project(gl, target))
else: # it is a group - get all projects
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment