mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-12 05:40:17 +00:00
feat: Disabling GitLab project features with bash script.
- Introduce new bash script to modify GitLab project settings - Prompt user for environment variables if not set - Disables various project features and access levels via GitLab API request
This commit is contained in:
parent
39c6e7e828
commit
fa2e9d4c30
1 changed files with 33 additions and 0 deletions
33
bin/gl-repo-simpler
Normal file
33
bin/gl-repo-simpler
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
if [ -z "$GITLAB_HOST" ]; then
|
||||
echo "Give me your GL HOST(with https://)"
|
||||
read GITLAB_HOST
|
||||
fi
|
||||
if [ -z "$PROJECT_ID" ]; then
|
||||
echo "Give me Project ID"
|
||||
read PROJECT_ID
|
||||
fi
|
||||
if [ -z "$PAT" ]; then
|
||||
echo "Give me your PAT"
|
||||
read -s PAT
|
||||
fi
|
||||
|
||||
curl --request PUT \
|
||||
--url "$GITLAB_HOST/api/v4/projects/$PROJECT_ID" \
|
||||
--header "Authorization: Bearer $PAT" \
|
||||
--header "content-type: multipart/form-data" \
|
||||
--form wiki_enabled=false \
|
||||
--form packages_enabled=false \
|
||||
--form snippets_access_level=disabled \
|
||||
--form monitor_access_level=disabled \
|
||||
--form feature_flags_access_level=disabled \
|
||||
--form infrastructure_access_level=disabled \
|
||||
--form releases_access_level=disabled \
|
||||
--form security_and_compliance_access_level=disabled \
|
||||
--form container_registry_access_level=disabled \
|
||||
--form merge_requests_access_level=disabled \
|
||||
--form issues_access_level=disabled \
|
||||
--form auto_devops_enabled=false \
|
||||
--form forking_access_level=disabled \
|
||||
--form analytics_access_level=disabled \
|
||||
--form builds_access_level=disabled
|
Loading…
Add table
Reference in a new issue