Skip to content

Setting up a private repository

a-a-hofmann edited this page Aug 26, 2020 · 4 revisions

On the backend

Create an RSA key pair with:

ssh-keygen -t rsa -m PEM -C "access@ifi.uzh.ch"

Call the key id_gitlab

Put the private key in the folder

/root/access/infrastructure/.ssh

Add url to repositories.json as (see https://github.com/mp-access/Course-Service/wiki/Adding-a-new-repository)

git@gitlab.com:<private-repo>.git

Make sure ~./ssh/config include the following:

Host gitlab.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_gitlab

On Gitlab

From private repository on Gitlab: Settings -> Repository -> Deploy Keys (collapse) -> Give a title to the key and paste contents of id_gitlab.pub

On Github

Settings -> Deploy Keys -> Add Deploy keys -> Give a title to the key and paste contents of pub key

Clone this wiki locally