Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible CI
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
Ansible
Ansible CI
Commits
985a57ee
Commit
985a57ee
authored
4 years ago
by
Robotka István Adrián
Browse files
Options
Downloads
Patches
Plain Diff
protet tags
parent
ce7f26b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
git-sch-scripts/setup.py
+22
-0
22 additions, 0 deletions
git-sch-scripts/setup.py
with
22 additions
and
0 deletions
git-sch-scripts/setup.py
+
22
−
0
View file @
985a57ee
...
@@ -36,6 +36,7 @@ def repo_action(project_meta):
...
@@ -36,6 +36,7 @@ def repo_action(project_meta):
# print(project_meta)
# print(project_meta)
setup_project
(
project_meta
)
setup_project
(
project_meta
)
add_youtrack
(
project_meta
)
add_youtrack
(
project_meta
)
check_tags
(
project_meta
)
def
update_project
(
project_meta
,
data
,
postfix
=
''
):
def
update_project
(
project_meta
,
data
,
postfix
=
''
):
...
@@ -78,4 +79,25 @@ def add_youtrack(project_meta):
...
@@ -78,4 +79,25 @@ def add_youtrack(project_meta):
update_project
(
project_meta
,
data
,
postfix
)
update_project
(
project_meta
,
data
,
postfix
)
def
check_tags
(
project_meta
):
path
=
'
projects/
'
path
+=
str
(
project_meta
[
'
id
'
])
path
+=
'
/protected_tags
'
tags
=
request
(
path
)
if
len
(
tags
)
==
0
:
protect_tags
(
path
)
def
protect_tags
(
path
):
data
=
{
'
name
'
:
'
v*
'
,
'
create_access_level
'
:
'
40
'
}
r
=
requests
.
post
(
url
=
get_url
(
path
),
data
=
data
)
if
r
.
ok
:
print
(
"
Protected
"
)
else
:
print
(
"
ERROR protecting tag
"
)
iterate_group
(
1604
)
iterate_group
(
1604
)
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