https://github.com/h44z/gitlab-github-mirror
Just a simple project for testing gitlab to github mirroring
https://github.com/h44z/gitlab-github-mirror
github gitlab gitlab-ci mirror
Last synced: about 2 months ago
JSON representation
Just a simple project for testing gitlab to github mirroring
- Host: GitHub
- URL: https://github.com/h44z/gitlab-github-mirror
- Owner: h44z
- License: mit
- Created: 2018-03-09T15:43:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-10T11:03:32.000Z (over 8 years ago)
- Last Synced: 2025-03-22T21:35:47.589Z (over 1 year ago)
- Topics: github, gitlab, gitlab-ci, mirror
- Homepage: https://git.sprinternet.at/h44z/gitlab-github-mirror
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Gitlab to Github mirroring
===
This repo is used for testing mirroring of a gitlab repo to github using gitlab-ci.
For gitlab ee, there already exists a mirroring service, so this is only useful for gitlab ce.
# Prerequisites
Setup gitlab-ci and create a shell runner. (https://docs.gitlab.com/runner/install/)

Next create or edit the file `/etc/ssh/ssh_known_hosts`:
```bash
# touch /etc/ssh/ssh_known_hosts
```
Allow the runner to modify the file (not needed if you do not update the ssh keys automatically):
```bash
# chown :gitlab-runner /etc/ssh/ssh_known_hosts
# chmod g+w /etc/ssh/ssh_known_hosts
```
You can prefill the known hosts file (you can also run this step in the gitlab runner):
```bash
# ssh-keyscan -t rsa,dsa,ecdsa github.com > /etc/ssh/ssh_known_hosts
```
Then create a new ssh key-pair for the gitlab runner (do not use a key password!):
```bash
# su gitlab-runner
$ cd
$ ssh-keygen -t rsa -b 4096
$ cat .ssh/id_rsa.pub
```
Add the key to your github account.
Now just edit the `.gitlab-ci.yml` file in your repo to fit your needs. Enjoy the gitlab to github mirroring :)
Warning/Hint: changes on github will be overwritten!!