Skip to main content

Script used to create repos on Gitlab and Github. Then create a push mirror link between them Gitlab -> Github.

Project description

Pipeline Status PyPI Project License PyPI Project Version

GitLab Github Mirror Repo

This is a simple Python cli script will first create a new repo on Gitlab and Github. Then it will create a push mirror link between them. Where all changes on the Gitlab repo are pushed to the Github repo (Gitlab -> Github).

Usage

To use this script you will need to have an access token for both Gitlab and Github, both must have permissions to create new repositories on your behalf.

gitlab_github_mirror_repo -l "xxxx" -h "xxx" -u https://gitlab.com -r test123
pip install gitlab-github-mirror-repo
gitlab_github_mirror_repo --help

Usage: gitlab_github_mirror_repo [OPTIONS]

A Python script used to mirror repos.

Options:
-l, --gitlab-private-token TEXT

Private GITLAB token, used to authenticate when calling the Gitlab API. [required]

-u, --gitlab-url TEXT

The GitLab URL i.e. gitlab.com. [required]

-h, --github-private-token TEXT

Private GITHUB token, used to authenticate when calling the Github API. [required]

-r, --repo-name TEXT

The name of the repository on Github and Gitlab. [required]

--help

Show this message and exit.

Docker

You can also use the Docker image like:

docker run gitlab-github-mirror-repo -l "xxxx" -h "xxx" -u https://gitlab.com -r test123

Predefined Variables

Please note some of the arguments can be filled in using environment variables.

  • If --gitlab-private-token is not set the script will look for the ENV variable GITLAB_PRIVATE_TOKEN

  • If --github-private-token is not set it will look for for the ENV variable GITHUB_PRIVATE_TOKEN

Setup Development Environment

git clone git@gitlab.com:gitlab-automation-toolkit/gitlab-github-mirror-repo.git
cd gitlab-github-mirror-repo
pip install tox
make install-venv
source .venv/bin/activate
make install-dev

Changelog

You can find the changelog here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitlab-github-mirror-repo-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file gitlab-github-mirror-repo-0.1.1.tar.gz.

File metadata

  • Download URL: gitlab-github-mirror-repo-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for gitlab-github-mirror-repo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f530c6c7e33d4828a0ab23462ccebdfe61b6364c7baad980a57ed593047122ed
MD5 c12182ab5f56382aa122769c7cf518cc
BLAKE2b-256 3527f2a93127fa24a84ee15559279c2b9a38de7f5d49daeb1e538466c8a6b7c5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page