/github-to-gitlab-sync

Dockerized program to push/sync specific Users/Orgs from Github to Gitlab

Primary LanguagePythonApache License 2.0Apache-2.0

github-to-gitlab-sync

Dockerized program to push specific Users/Orgs

from: https://Github.com

to: https://Gitlab.com or your self hosted Gitlab instance.

You cannot sync specific repos, only all repos under a User or Org.


Before you start, please read .env.template to understand the env vars for this program.

Specifically note this one:

SYNC_CONFIG="SomeGithubOrgName:org/ThatOrgOnGitlab,torvalds:user/torvalds

This is the sync config, this example would do the following:

  1. Sync Github Org "SomeGithubOrgName" repos to Gitlab under Gitlab Group named "ThatOrgOnGitlab".
  2. Sync Github User "torvalds" repos to Gitlab under Gitlab User "torvalds".

You may add as many as you wish, comma seperated.

How to run

Create a Github Token

Create a Gitlab Token

Set all the env vars within .env.template.

Run it:

pip install docker-compose
docker-compose build app
docker-compose run app

Or without docker:

pip install -r requirements.txt
bash run.sh

Advanced

To have the program run forever, set RUN_CONTINUOUSLY=true. (Also adjust SECS_SLEEP_BETWEEN_RUNS).