带自托管Gitlab的Netlify CMS

时间:2018-08-24 11:29:10

标签: gitlab netlify netlify-cms

我有一个Gatsby静态站点,当前是通过Zeit Now从一个自托管的Gitlab帐户进行部署的。

我想添加Netlify CMS,但要添加only seems to integrate with a Gitlab.com account

是否可以通过自托管的Gitlab帐户使用Netlify CMS?

2 个答案:

答案 0 :(得分:6)

您将能够将 Netlify CMS 与自托管的 Gitlab 服务器using Implicit Grant

一起使用

文档显示,backend文件中config.yml的选项如下:

backend:
  name: gitlab
  repo: owner-name/repo-name # Path to your GitLab repository
  auth_type: implicit # Required for implicit grant
  app_id: your-app-id # Application ID from your GitLab settings
  api_root: https://my-hosted-gitlab-instance.com/api/v4
  base_url: https://my-hosted-gitlab-instance.com
  auth_endpoint: oauth/authorize

在Gitlab上::设置application on Gitlab以获得app_id并设置重定向URI,输入访问Netlify CMS的地址,例如{{3 }}。对于范围,请选择 api

答案 1 :(得分:1)

通过使用Netlify CLI,将其设置为从自托管/托管的GitLab自动部署。

您需要配置 SSH密钥 webhook集成。这是详细的指南:Auto Deploy to Netlify from Self-hosted GitLab