Git Product home page Git Product logo

gitlab-remote-mirror's Introduction

GitLab Remote Mirror Script

This simple bash script provides functionality for mirroring repositories from GitLab Community Edition to any git server (even with Git LFS support).

Requirements

  • Git
  • Git LFS (for repositories with LFS)

Configuration

The script will load each *.cnf file from the repositories.d directory.
Example of a *.cnf file:

SOURCE_PATH="/var/opt/gitlab/git-data/repositories/group/local-repo.git" # Path to the local GitLab bare repository
TARGET_URL="https://user:[email protected]/remote-repo.git" # HTTPS or SSH url to the target repository
# LFS=1 # (optional) enable LFS mirroring
# GITLAB_LFS_OBJECTS_PATH="/var/opt/gitlab/gitlab-rails/shared/lfs-objects" # (optional) path to the GitLab LFS storage

The script will push all changes from the local repository specified in the SOURCE_PATH variable to the remote repository specified in the TARGET_URL.

Docker image

You can install the mirror script as an isolated Docker image. This way you don't even need to install Git and Git LFS and configure cron.

Docker image requirements

Installation

Configure

Copy docker-compose.yml.dist into docker-compose.yml and change as you need.
Copy crontab.dist into crontab and change the script run time as needed.
Place your repository mirror configurations into the repositories.d folder (see details above).

Build the image and start the container

docker-compose build
docker-compose up -d

Administration

Log into the running container

docker exec -ti gitlab-remote-mirror env TERM=xterm bash -l

gitlab-remote-mirror's People

Contributors

vitaliitsilnyk avatar nobitagamer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.