A super simple GIT project for testing gitlab to github mirroring.
Go to file
Christoph Haas 8fe66ad446 Update .gitlab-ci.yml 2018-03-10 12:03:25 +01:00
.gitlab-ci.yml Update .gitlab-ci.yml 2018-03-10 12:03:25 +01:00
LICENSE Add new file 2018-03-09 16:42:16 +01:00
README.md Update README.md 2018-03-10 12:00:24 +01:00
runner.png Upload New File 2018-03-10 11:51:23 +01:00


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.


Setup gitlab-ci and create a shell runner. (https://docs.gitlab.com/runner/install/)

Runner Configuration

Next create or edit the file /etc/ssh/ssh_known_hosts:

# touch /etc/ssh/ssh_known_hosts

Allow the runner to modify the file (not needed if you do not update the ssh keys automatically):

# 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):

# 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!):

# 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!!