Update README.md
This commit is contained in:
parent
385887436b
commit
42a91bf99e
28
README.md
28
README.md
@ -5,33 +5,33 @@ This repo is used for testing mirroring of a gitlab repo to github using gitlab-
|
|||||||
For gitlab ee, there already exists a mirroring service, so this is only useful for gitlab ce.
|
For gitlab ee, there already exists a mirroring service, so this is only useful for gitlab ce.
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
Setup gitlab-ci and create a shell runner.
|
Setup gitlab-ci and create a shell runner. (https://docs.gitlab.com/runner/install/)
|
||||||
|
|
||||||
![Runner Configuration](https://git.sprinternet.at/h44z/atestproject/raw/master/runner.png "Runner Configuration")
|
![Runner Configuration](https://raw.githubusercontent.com/h44z/atestproject/master/runner.png)
|
||||||
|
|
||||||
Next create or edit the file `/etc/ssh/ssh_known_hosts`:
|
Next create or edit the file `/etc/ssh/ssh_known_hosts`:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
touch /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):
|
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
|
# chown :gitlab-runner /etc/ssh/ssh_known_hosts
|
||||||
chmod g+w /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):
|
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
|
# 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!):
|
Then create a new ssh key-pair for the gitlab runner (do not use a key password!):
|
||||||
```
|
```bash
|
||||||
su gitlab-runner
|
# su gitlab-runner
|
||||||
cd
|
$ cd
|
||||||
ssh-keygen -t rsa -b 4096
|
$ ssh-keygen -t rsa -b 4096
|
||||||
cat .ssh/id_rsa.pub
|
$ cat .ssh/id_rsa.pub
|
||||||
```
|
```
|
||||||
|
|
||||||
Add the key to your github account.
|
Add the key to your github account.
|
||||||
|
Loading…
Reference in New Issue
Block a user