Skip to main content

One post tagged with "gitlab"

View All Tags

GitLab - Using a SSH key to connect to private repo

ยท 4 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

GitLab - Using a SSH key to connect to private repo

In this article, we'll see how to use a private SSH key using a GitLab CI.

The need: when running my CI, the GitLab runner has to be able to connect to my self-hosted (and private) GitLab environment. This because he'll need to pull from there private projects. Think to a PHP project f.i. : in my composer.json, I'm referring to dependencies hosted on my GitLab server. Or, same for a Javascript project and his package.json file.

Another example: my CI will produce some files (like a .pdf one) by converting some Markdown documents to a real documentation. At the end of this conversion, the PDF has to be pushed to the repository.

My need is thus: I should share my SSH key with the GitLab runner.