Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
d48b6a14
Commit
d48b6a14
authored
3 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[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
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/scripts/runners.py
+11
-5
11 additions, 5 deletions
bob/devtools/scripts/runners.py
bob/devtools/scripts/settings.py
+1
-1
1 addition, 1 deletion
bob/devtools/scripts/settings.py
with
12 additions
and
6 deletions
bob/devtools/scripts/runners.py
+
11
−
5
View file @
d48b6a14
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/settings.py
+
1
−
1
View file @
d48b6a14
...
...
@@ -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
el
if
not
group
:
# it is a specific project
gl_projects
.
append
(
_get_project
(
gl
,
target
))
else
:
# it is a group - get all projects
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment