No release in over 3 years
Low commit activity in last 3 years
Checks for gitlab repositories with a set remote and run git fetch on these. Features: send mail for reports/error, webhook integration, trigger pipeline
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.3.0, ~> 1.3
>= 4.4.0, ~> 4.4
>= 2.7.0, ~> 2.7
>= 2.0.3, ~> 2.0
 Project Readme

gitlab-mirror-pull

Gitlab-mirror-pull automatically fetches and updates GitLab repositories.

Description

Update your git repositories automatically when remote is set

  • Adds a command to fetch repositories
  • Run a tiny Webserver to integrate with Gitlabs webhooks
  • Adds init script to /etc/init.d/gitlab-mirror-server
  • Send mail on error or just for reporting

Install (for development)

  • Clone repository: git clone https://github.com/ochorocho/gitlab-mirror-pull.git
  • Run bundler: bundle install
  • Copy and modify config.example.yml to config.yml

Run

./bin/gitlab-mirror-pull -c config.yml -l INFO

Using 'gem install'

Install

gem install gitlab-mirror-pull

⚠️ Make sure you run the script/server as git user. This is default for omnibus installation but may differ. In case you run the binary directly use this command sudo -u git -H gitlab-mirror-pull

Example configuration

see config.yml

Run

gitlab-mirror-pull -c /path/to/config.yml

Default config location

/etc/gitlab-mirror-pull/config.yml

Setup a CronJob

If you want to trigger periodically

* */1 * * *     git /usr/bin/ruby /usr/local/bin/gitlab-mirror-pull

Setup gitlab webhook

Allow webhooks on localhost in gitlab (Admin -> Settings -> Outbound requests) and check Allow requests to the local network from hooks and services and hit save

Go to your porject -> Settings -> Integrations:

  • Add URL http://localhost:8088/commit
  • Leave Token empty
  • Check Enable SSL verification
  • Tick boxes to enable Triggers
  • Run server sudo /etc/init.d/gitlab-mirror-server start

Logs

  • /var/log/gitlab-mirror-server.err
  • /var/log/gitlab-mirror-server.log

Run with docker

docker run -ti --rm -v "/absolute/path/to/repositories/":/repositories  -v "/absolute/path/to/config.docker.yml":/config.docker.yml ochorocho/gitlab-mirror-pull