Giter Site home page Giter Site logo

mirror-to-gitlab's Introduction

Mirror git repos to Gitlab

This script will mirror any git repo to a gitlab server. This repo is setup to run the gitlab ci pipeline on a cron job to get updates from all repos.

Requirements

  • bash
  • git
  • curl
  • Environment Variables:
    # Fill in the values with your info to use the script
    
    # gitlab user access token, needs api & write repo permissions
    export MIRROR_GITLAB_TOKEN=<ACCESS_TOKEN_HERE>
    # URL that will be the new remote of the repo (minus the name). NOTE: NO `/` at the end
    export MIRROR_GITLAB_DOMAIN=<SERVER DOMAIN>
    export MIRROR_GITLAB_URL=https://gitlab-ci-token:${MIRROR_GITLAB_TOKEN}@${MIRROR_GITLAB_DOMAIN}/<GROUP_NAME>
    # The group id you want the mirrors to save to
    export MIRROR_GITLAB_NAMESPACE_ID=<GROUP_ID>
    
    # Optional
    # Clone the repo into this directory, will use local dir if not set
    export MIRROR_PATH=/foo/bar
    # If set to true, it will delete the locally cloned git repo. Default is false
    export MIRROR_CLEANUP=false

Usage

  • Add repos, 1 per line in a file called repos.txt
  • Run to mirror all repos in the file ./mirror-to-gitlab.sh

mirror-to-gitlab's People

Contributors

xtream1101 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.