Gitlab-mirror-pull automatically fetches and updates GitLab repositories.
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
- Clone repository:
git clone https://github.com/ochorocho/gitlab-mirror-pull.git
- Run bundler:
bundle install
- Copy and modify
config.example.yml
toconfig.yml
./bin/gitlab-mirror-pull -c config.yml -l INFO
gem install gitlab-mirror-pull
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
see config.yml
gitlab-mirror-pull -c /path/to/config.yml
Default config location
/etc/gitlab-mirror-pull/config.yml
If you want to trigger periodically
* */1 * * * git /usr/bin/ruby /usr/local/bin/gitlab-mirror-pull
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
docker run -ti --rm -v "/absolute/path/to/repositories/":/repositories -v "/absolute/path/to/config.docker.yml":/config.docker.yml ochorocho/gitlab-mirror-pull