{"id":21493381,"url":"https://github.com/microdevops-com/gitlab-admin","last_synced_at":"2025-07-04T06:35:39.894Z","repository":{"id":48563521,"uuid":"208005016","full_name":"microdevops-com/gitlab-admin","owner":"microdevops-com","description":"Setup multiple GitLab projects with settings defined by YAML","archived":false,"fork":false,"pushed_at":"2025-06-25T09:57:02.000Z","size":90,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T10:51:09.003Z","etag":null,"topics":["gitlab"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microdevops-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-12T08:46:54.000Z","updated_at":"2025-06-25T09:57:06.000Z","dependencies_parsed_at":"2023-11-22T19:26:06.485Z","dependency_job_id":"2f9c8931-84f5-4471-8552-b3db642d67d2","html_url":"https://github.com/microdevops-com/gitlab-admin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/microdevops-com/gitlab-admin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Fgitlab-admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Fgitlab-admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Fgitlab-admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Fgitlab-admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microdevops-com","download_url":"https://codeload.github.com/microdevops-com/gitlab-admin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdevops-com%2Fgitlab-admin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263463427,"owners_count":23470447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab"],"created_at":"2024-11-23T15:42:17.485Z","updated_at":"2025-07-04T06:35:39.880Z","avatar_url":"https://github.com/microdevops-com.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IMPORTANT!\n- Gitlab version 13.12 or higher required.\n\n# Setup with symlinks\nEnv var `GL_ADMIN_PRIVATE_TOKEN` needed to access GitLab as Admin to create and setup projects.\nEnv vars `PG_DB_HOST`, `PG_DB_NAME`, `PG_DB_USER`, `PG_DB_PASS` for access to GitLab PostgreSQL DB are required to set these options (API lacks support):\n- `skip_outdated_deployment_jobs`\n- `deploy_tokens`\n\nAdd this repo as Git Submodule to a project:\n```\ngit submodule add --name .gitlab-admin -b master -- https://github.com/microdevops-com/gitlab-admin .gitlab-admin\n```\n\nAdd symlinks to submodule:\n```\nln -s .gitlab-admin/requirements.txt\nln -s .gitlab-admin/issues.py\nln -s .gitlab-admin/projects.py\nln -s .gitlab-admin/settings.py\n```\n\nInstall python3 requirements:\n```\npip3 install -r requirements.txt\n```\n\n# Setup with docker compose\n\nMake sure your uid is set to 1000, otherwise you will have permission issues with the mounted volumes.\n\nCheck docker host docker group id, update it in `Dockerfile.compose` if needed.\n\nRun:\n```\ndocker compose run --rm --build gitlab-admin\n```\n\n# `./settings.py`\nSetup global GitLab settings.\nRun `./settings.py --apply-settings` to apply GitLab settings.\n\n# `./projects.py`\nSetup multiple GitLab projects with settings defined by YAML, see [projects.yaml.example](projects.yaml.example) for example.\n\nRun `./projects.py --setup-projects` to create and/or setup projects in GitLab.\n\nRun `./projects.py --template-projects` to update templates within via git.\nGit is used via local cmd run.\n\nRun `./projects.py --bulk-delete-tags-in-projects` to bulk delete docker registry tags by rules defined in YAML.\n\n# `./issues.py`\nImport issues or epics from Jira, rules defined by YAML, see [issues.yaml.example](issues.yaml.example) for example.\n\nRun `./issues.py --import-epics-from-jira` to import epics.\nRun `./issues.py --import-issues-from-jira` to import issues.\n\n# `./registry.py`\nThe script is used to pull the GitLab container registry of specific project locally, then push it to another project.\nThis is helpful if you need to move or rename the project as GitLab does not support this while there are existing images in the registry.\n\nSet env vars in `.env` file, docker compose will use it:\n  - `PULL_GITLAB_USER` - GitLab user to pull images from registry\n  - `PULL_GITLAB_TOKEN` - GitLab user token to pull images from registry and to connect to GitLab API\n  - `PUSH_GITLAB_USER` - GitLab user to push images to registry\n  - `PUSH_GITLAB_TOKEN` - GitLab user token to push images to registry and to connect to GitLab API\n\nEnter docker compose container:\n```\ndocker compose run --rm gitlab-admin\n```\n\nPull images, you can omit `--delete-tags-after-pull` first time just to make sure everything works:\n```\n./registry.py --ids-file ids.txt --pull-gitlab-url https://gitlab.example.org --pull-project-path old/path\n```\n\nPull together with deleting tags after pull:\n```\n./registry.py --ids-file ids.txt --pull-gitlab-url https://gitlab.example.org --pull-project-path old/path --delete-tags-after-pull\n```\n\nMove or rename the project.\n\nCheck local images and note old registry location in their repository location column:\n```\ndocker image ls\n```\n\nPush images:\n```\n./registry.py --ids-file ids.txt --push-gitlab-url https://gitlab.example.org --push-project-path new/path --old-registry-location gitlab.example.org:5001/old/path\n```\n\nAfter pushing the images second attempt will not pass, as additional tags will be added to the local images. Delete local images and pull them again to make another attempt.\n\nDelete local images:\n```\n./registry.py --ids-file ids.txt --rm-images\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrodevops-com%2Fgitlab-admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrodevops-com%2Fgitlab-admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrodevops-com%2Fgitlab-admin/lists"}