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
08dcdedf
Commit
08dcdedf
authored
3 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[scripts.settings] Be more flexible with group discovery
parent
842965eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#57060
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/scripts/settings.py
+12
-6
12 additions, 6 deletions
bob/devtools/scripts/settings.py
with
12 additions
and
6 deletions
bob/devtools/scripts/settings.py
+
12
−
6
View file @
08dcdedf
...
@@ -20,7 +20,7 @@ logger = get_logger(__name__)
...
@@ -20,7 +20,7 @@ logger = get_logger(__name__)
def
_change_settings
(
project
,
info
,
dry_run
):
def
_change_settings
(
project
,
info
,
dry_run
):
"""
Updates the project settings using ``info``
"""
"""
Updates the project settings using ``info``
"""
name
=
f
"
{
project
.
namespace
[
'
name
'
]
}
/
{
project
.
name
}
"
name
=
f
"
{
project
.
namespace
[
'
full_path
'
]
}
/
{
project
.
name
}
"
echo_normal
(
f
"
Changing
{
name
}
...
"
)
echo_normal
(
f
"
Changing
{
name
}
...
"
)
if
info
.
get
(
"
archive
"
)
is
not
None
:
if
info
.
get
(
"
archive
"
)
is
not
None
:
...
@@ -76,6 +76,12 @@ Examples:
...
@@ -76,6 +76,12 @@ Examples:
type
=
str
,
type
=
str
,
help
=
"
Set this to update the project description
"
,
help
=
"
Set this to update the project description
"
,
)
)
@click.option
(
"
-g
"
,
"
--group/--no-group
"
,
default
=
False
,
help
=
"
If set, consider the the provided name as a group name
"
,
)
@click.option
(
@click.option
(
"
-A
"
,
"
-A
"
,
"
--archive/--unarchive
"
,
"
--archive/--unarchive
"
,
...
@@ -92,7 +98,7 @@ Examples:
...
@@ -92,7 +98,7 @@ Examples:
)
)
@verbosity_option
()
@verbosity_option
()
@bdt.raise_on_error
@bdt.raise_on_error
def
settings
(
projects
,
avatar
,
description
,
archive
,
dry_run
):
def
settings
(
projects
,
avatar
,
description
,
group
,
archive
,
dry_run
):
"""
Updates project settings
"""
"""
Updates project settings
"""
# if we are in a dry-run mode, let's let it be known
# if we are in a dry-run mode, let's let it be known
...
@@ -105,12 +111,12 @@ def settings(projects, avatar, description, archive, dry_run):
...
@@ -105,12 +111,12 @@ def settings(projects, avatar, description, archive, dry_run):
for
target
in
projects
:
for
target
in
projects
:
if
"
/
"
in
target
:
# it is a specific project
if
os
.
path
.
exists
(
target
):
# it is a file with project names
gl_projects
.
append
(
_get_project
(
gl
,
target
))
elif
os
.
path
.
exists
(
target
):
# it is a file with project names
gl_projects
+=
_get_projects_from_file
(
gl
,
target
)
gl_projects
+=
_get_projects_from_file
(
gl
,
target
)
if
not
group
:
# it is a specific project
gl_projects
.
append
(
_get_project
(
gl
,
target
))
else
:
# it is a group - get all projects
else
:
# it is a group - get all projects
gl_projects
+=
_get_projects_from_group
(
gl
,
target
)
gl_projects
+=
_get_projects_from_group
(
gl
,
target
)
...
...
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