Skip to main content

Mirror your git repositories and make them cgit-ready

Project description

cgitize

Test

Mirror your git repositories and make them cgit-ready.

Example output can be found at https://egort.name/git/.

Usage

Adjust the sample config in examples/cgitize.conf and pass its path as the --config parameter value:

> python3 -m cgitize.main --config path/to/cgitize.conf

The repository list is stored in my_repos.py (the my_repos setting in the config). See examples/my_repos.py for an example.

cgitize/main.py calls git, which might call ssh internally. Make sure the required keys are loaded to a ssh-agent.

Docker

The image is egortensin/cgitize. The container reads the config from /etc/cgitize/cgitize.conf and writes the repositories to /var/tmp/cgitize/output. If SSH is required, the socket should be mapped to /var/run/cgitize/ssh-agent.sock.

> docker run -it --rm                                   \
    -v "/path/to/config:/etc/cgitize:ro"                \
    -v "$SSH_AUTH_SOCK:/var/run/cgitize/ssh-agent.sock" \
    -v "/path/to/output:/var/tmp/cgitize/output"        \
    egortensin/cgitize

The container executes cgitize inside a cron job. The SCHEDULE environment variable controls the period between cgitize runs. By default, it's set to once, which makes the container exit after the first run. You can also set it to 15min, hourly, daily, weekly, monthly or a custom 5-part cron schedule like */5 * * * *.

Mirror maintenance

Update the URL of an existing repository mirror:

> git remote set-url origin ssh://git@examples.com/username/name.git

Development

Linting

Requires Pylint.

> pylint cgitize

License

Distributed under the MIT License. See LICENSE.txt for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgitize-0.1.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

cgitize-0.1-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page