Metadata-Version: 2.4
Name: gitlab-rulez
Version: 0.0.0
Summary: A tool to verify and correct GitLab project settings
Author-email: Ariel D'Alessandro <ariel.dalessandro@collabora.com>, Arnaud Ferraris <arnaud.ferraris@collabora.com>, Dylan Aïssi <dylan.aissi@collabora.com>, Emanuele Aina <emanuele.aina@collabora.com>, Frédéric Dalleau <frederic.dalleau@collabora.co.uk>, Frédéric Danis <frederic.danis@collabora.com>, Ritesh Raj Sarraf <ritesh.sarraf@collabora.com>, Ulrich Eckhardt <ulrich.eckhardt@base-42.de>, Walter Lozano <walter.lozano@collabora.com>
Project-URL: Homepage, https://gitlab.apertis.org/infrastructure/gitlab-rulez
Keywords: gitlab,python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9.0
Description-Content-Type: text/markdown
Requires-Dist: python-gitlab>=3.0.0
Requires-Dist: pyyaml>=6.0.2

# gitlab-rulez

Compute and apply changes to the settings of the projects in a GitLab instance
based on a set of YAML rules.

## Installation

For development purposes, you can run the tool locally like this:

```shell
# preferred syntax
python -m gitlab_rulez --help
# deprecated syntax
./gitlab-rulez --help
```

For production use, install the tool as a dependency e.g. in a Python
virtual environment:

```shell
# create venv
python -m venv venv
source venv/bin/activate

# install gitlab-rulez
pip install git+https://gitlab.apertis.org/infrastructure/gitlab-rulez.git

# run it
gitlab-rulez --help
```

## Usage

First, configure the GitLab access credentials for python-gitlab:
https://python-gitlab.readthedocs.io/en/stable/cli-usage.html#configuration

Create a `rulez.yaml` file with expected GitLab setting rules, see `sample-rulez.yaml`.

Then check what currently violates the rules so far defined:

    gitlab-rulez diff ./rulez.yaml

If what gitlab-rulez highlights seem sensible, tell it to poke your GitLab
instance until it is happy:

    gitlab-rulez apply ./rulez.yaml

To limit the changes to a single project, use `--filter`:

    gitlab-rulez apply ./rulez.yaml --filter pkg/target/systemd
