GithubHelp home page GithubHelp logo

percenuage / git-sync Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 59 KB

A script to synchronize Bitbucket remote repositories to Gitlab

JavaScript 95.84% Dockerfile 4.16%
git sync nodejs bitbucket gitlab mirror

git-sync's Introduction

Git Sync

A simple node script to synchronize Bitbucket remote repositories to Gitlab periodically.

It's a unidirectional synchronization from Bitbucket to Gitlab.

By default, the script will run once. If you want it to run periodically (eg. every minutes), you need to add CRONTAB=* * * * * environment variable.

Script steps:

  1. Get the name of the repositories to synchronize from REPOSITORIES=repo1,repo2,... environment variable.
  2. Check if these names exist on your bitbucket account.
  3. Get the paths of the repositories on your Gitlab account.
  4. If there is no Gitlab repository matching the name, the repository will be created.
  5. Clone (bare) from Bitbucket and push (mirror) to Gitlab.
  6. Done

Getting Started

Environment Variables

Variable Default Example
BITBUCKET_USERNAME - jdoe
BITBUCKET_PASSWORD - xxxx
BITBUCKET_GROUP_ID - johndoe
GITLAB_TOKEN - xxxx
GITLAB_GROUP_ID - 0000000
REPOSITORIES - rep1,rep2
EXEC_CWD /tmp /tmp
CRONTAB - * * * * *

Docker

$ docker run -e GITLAB_TOKEN=xxxxx -e REPOSITORIES=git-sync -e CRONTAB="* * * * *" percenuage/get-sync:latest

or

$ docker run --env-file=.env percenuage/get-sync:latest

Sources

git-sync's People

Contributors

percenuage avatar

Stargazers

 avatar

Watchers

 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.