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
3e2c77d6
Verified
Commit
3e2c77d6
authored
Aug 15, 2020
by
Robotka István Adrián
Browse files
Options
Downloads
Patches
Plain Diff
ANS-3 setup project settings
parent
9cb17193
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
git-sch-scripts/README.md
+0
-3
0 additions, 3 deletions
git-sch-scripts/README.md
git-sch-scripts/regulator.sh
+2
-3
2 additions, 3 deletions
git-sch-scripts/regulator.sh
git-sch-scripts/setup.py
+25
-5
25 additions, 5 deletions
git-sch-scripts/setup.py
with
27 additions
and
11 deletions
git-sch-scripts/README.md
+
0
−
3
View file @
3e2c77d6
...
...
@@ -13,9 +13,6 @@ virtualenv .venv
# enter virtualenv
source
.venv/bin/activate
# install requirements
pip
install
-r
requirements.python.txt
cp
env.example
env
vim
env
...
...
This diff is collapsed.
Click to expand it.
git-sch-scripts/regulator.sh
+
2
−
3
View file @
3e2c77d6
...
...
@@ -7,11 +7,10 @@ source ./env
export
PERSONAL_API_TOKEN
log
()
{
echo
echo
'######################'
echo
"#
$*
"
echo
'######################'
}
log
'
Disable shared runner
s'
python3
disable_shared_runners
.py
log
'
Setup all the thing
s'
python3
setup
.py
This diff is collapsed.
Click to expand it.
git-sch-scripts/
disable_shared_runners
.py
→
git-sch-scripts/
setup
.py
+
25
−
5
View file @
3e2c77d6
...
...
@@ -5,6 +5,7 @@ import os
host
=
"
git.sch.bme.hu
"
personal_token
=
os
.
environ
[
'
PERSONAL_API_TOKEN
'
]
def
get_url
(
path
)
->
str
:
url
=
"
https://
"
url
+=
host
...
...
@@ -32,18 +33,37 @@ def iterate_group(group_id: int):
def
repo_action
(
project_meta
):
if
project_meta
[
'
shared_runners_enabled
'
]:
has_shared_runner_action
(
project_meta
)
# print(
project_meta
)
setup_project
(
project_meta
)
def
has_shared_runner_action
(
project_meta
):
def
update_project
(
project_meta
,
data
):
path
=
'
projects/
'
+
str
(
project_meta
[
'
id
'
])
data
=
{
'
shared_runners_enabled
'
:
False
}
r
=
requests
.
put
(
url
=
get_url
(
path
),
data
=
data
)
if
r
.
ok
:
print
(
"
Chang
ed:
"
+
project_meta
[
'
name
'
])
print
(
"
Updat
ed:
"
+
project_meta
[
'
name
'
])
else
:
print
(
"
ERROR:
"
+
project_meta
[
'
name
'
])
def
setup_project
(
project_meta
):
data
=
{
'
merge_method
'
:
'
rebase_merge
'
,
'
merge_requests_enabled
'
:
True
,
'
lfs_enabled
'
:
True
,
'
only_allow_merge_if_pipeline_succeeds
'
:
True
,
'
only_allow_merge_if_all_discussions_are_resolved
'
:
True
,
'
remove_source_branch_after_merge
'
:
True
,
'
issues_enabled
'
:
False
,
'
snippets_enabled
'
:
False
,
'
wiki_enabled
'
:
False
,
'
container_registry_enabled
'
:
False
,
'
shared_runners_enabled
'
:
False
,
'
auto_devops_enabled
'
:
False
}
update_project
(
project_meta
,
data
)
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