DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

olistik
olistik

Posted on

Configure a custom Git repository on Netlify

My personal web site (https://olisti.co) is a Gatsby.js project I used to serve publicly through Netlify but this required me to use Github.

Since I have my own Gitlab instance (https://source.olisti.co) I wanted to configure Netlify's CI to point to my Gitlab repository instead.

After a few attempts, I discovered that it's currently not possible to update the repository URL via:

  • the web UI: since it doesn't provide the option to specify a self-hosted Gitlab instance or to specify a manual Git URL.
  • netlify api updateSite since passing a build_settings object doesn't change the remote configuration, at least for the repo_url attribute.

I had to delete and recreate the Netlify site and configure it with netlify-cli specifying these parameters:

Ξ» netlify sites:create --manual --with-ci

Here, --with-ci does the trick since it allows to specify the ssh URL of the Git repository.

One last hiccup has been while trying to provision the Let's Encrypt SSL certificate. A worrying error message showed up even though the required checks were passing.

It eventually went away after, I suppose, their local cache expired.

And now that I know this, I can import my other repositories. ;-)

Top comments (0)

πŸ‘‹ Hey, my name is Noah and I’m the one who set up this ad. My job is to get you to join DEV, so if you fancy doing me a favor, I’d love for you to create an account.

If you found DEV from searching around, here are a couple of our most popular articles on DEV: