Package: gitlabracadabra
Gitlabracadabra🧹 GitLabracadabra 🧙:alembic: Adds some magic to GitLab :crystal_ball:GitLab'racadabra is a GitOps way to configure aGitLabinstance
from a YAML configuration, using theAPI.It is able to create GitLab'sgroups,projects,usersandapplication settings.:thumbsup: It's also able to mirror :Git repositories, using themirrorsparameter inMirroring repositories.container (Docker) images, using theimage_mirrorsparameter. SeeMirroring container images.packages, using thepackage_mirrorsparameter. SeeMirroring packages.It is based onPython GitLab.Table of ContentsInstallationUsing Debian packagesUsing pipUsing docker imageFrom sourceConfigurationAction file(s)Using gitlabracadabra in GitLab CIContributingInstallationUsing Debian packagesDebian package is availablefrom artifactsand can be installed with:aptinstallgitlabracadabra_*.deb

gitlabracadabra--verbose--dry-runNote: Debian 10 buster or later is required.Using pippipinstallgitlabracadabraUsing docker imageThere are alsoDocker/OCI images.Example usage:sudodockerrun-ti\-v"$HOME/.python-gitlab.cfg:/home/gitlabracadabra/.python-gitlab.cfg:ro"\-v"$PWD/gitlabracadabra.yml:/app/gitlabracadabra.yml:ro"\'registry.gitlab.com/gitlabracadabra/gitlabracadabra:v1.13.0'\--verbose--dry-runOther images are available. Examples:registry.gitlab.com/gitlabracadabra/gitlabracadabra/main: Currentmainregistry.gitlab.com/gitlabracadabra/gitlabracadabra/main:b1cd3482bf9583c5db863c359e12cafcdb7119bf: A specific commit ofmainFrom sourceLocal installation (in$HOME/.local):# On Debian >= 10 (buster) or Ubuntu >= 19.04sudoaptinstallpython3-jsonschemapython3-gitlabpython3-yamlpython3-pygit2python3-coveragepython3-vcrpython3-pytest# On otherspipinstall-rrequirements.txt# Build, install and testpython3setup.pybuild
python3setup.pyinstall--user
pytest-3# or pytest~/.local/bin/gitlabracadabra--verbose--dry-runConfigurationGitLabracadabra uses the same configuration file as Python GitLab CLI to store
connection parameters.Example~/.python-gitlab.cfg:[global]default=gitlab[gitlab]url=https://gitlab.comprivate_token=T0K3NMore information inPython GitLab documentation.Action file(s)GitLabracadabraactionsare configured with a YAML file.SeeGitLabracadabra's own action fileor read:Action file syntaxlist of parameters:for projectsfor groupsfor usersfor application settingsUsing gitlabracadabra in GitLab CISince job token probably won't have enough permissions, you'll need to use a personal access token:create a personal access tokenDefinetheGITLAB_PRIVATE_TOKENprotectedvariableUse it in your jobs to configurepython-gitlab. Example.gitlab-ci.yml:default:image:name:'registry.gitlab.com/gitlabracadabra/gitlabracadabra:v1.13.0'entrypoint:[""]before_script:-|cat << EOF > ~/.python-gitlab.cfg[global]default = gitlab[gitlab]url = ${CI_SERVER_URL:-https://gitlab.com}private_token = ${GITLAB_PRIVATE_TOKEN}# job_token = ${GITLAB_JOB_TOKEN}EOFstages:-test-deploytest:stage:testscript:-gitlabracadabra --verbose --dry-runrules:-if:'$CI_COMMIT_BRANCH!="main"'apply:stage:deployscript:-gitlabracadabra --verboserules:-if:'$CI_COMMIT_BRANCH=="main"'ContributingFile bugs and feature requests inGitLab issues.
Security issues should be marked asconfidential.Propose documentation or code improvements inGitLab merge requests.This repository enforces commit message convention, to check this locally install thecommitlinthook:npminstall@commitlint/{config-conventional,cli}echo'npx commitlint --edit'>>.git/hooks/commit-msg
chmod+x.git/hooks/commit-msgSee also:Setting upa development environmentConfiguring VS codeReleasing GitLabracadabra.