DEV Community

olistik
olistik

Posted on

2

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
Enter fullscreen mode Exit fullscreen mode

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. ;-)

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay