Skip to content

Commit

Permalink
create 2 sections
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnbeelee committed Nov 20, 2024
1 parent 5715d3d commit a211f79
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 31 deletions.
Binary file added images/gitlab/gitlab-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/gitlab/gitlab-webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 45 additions & 31 deletions settings/gitlab.mdx
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
---
title: "GitLab"
description: "Sync your docs with a GitLab repo"
icon: 'gitlab'
icon: "gitlab"
---

<Check>
GitLab integration is available on the [Enterprise plan](https://mintlify.com/pricing).
GitLab integration is available on the [Enterprise
plan](https://mintlify.com/pricing).
</Check>

We use a combination of Access tokens and Webhooks to authenticate and sync changes between GitLab and Mintlify.
We use a combination of Access tokens and Webhooks to authenticate and sync
changes between GitLab and Mintlify.

* We use Access tokens to pull information from GitLab Mintlify.
* We use Webhooks so GitLab can notify Mintlify when changes are made.
* This allows Mintlify to create preview deployments when a MR is created.
- We use Access tokens to pull information from GitLab.
- We use Webhooks so GitLab can notify Mintlify when changes are made.
- This allows Mintlify to create preview deployments when a MR is created.

<Steps title="In Mintlify">
<Step title="Begin Setup">
Within your Mintlify dashboard, click on the `Settings` tab and select [`Git Settings`][git-settings].
</Step>
<Step title="Switch to GitLab">
Click on `Switch to GitLab` which will open a panel to enter your GitLab information.
</Step>
</Steps>
## Set up the connection

<Steps title="In GitLab">
<Steps>
<Step title="Find your project ID">
In another tab, navigate to your GitLab's project `Settings` > `General` and find the `Project ID`.
Within your GitLab project, navigate to `Settings` > `General` and find the `Project ID`.
<Frame>
<img src="/images/gitlab/gitlab-project-id.png" />
</Frame>
</Step>
<Step title="Generate an Access token">
a. Navigate to your GitLab's project `Settings` > `Access Tokens`.
<Step title="Generate an access token">
a. Navigate to `Settings` > `Access Tokens`.

b. Select `Add new token`.
1. Name the token "Mintlify".
Expand All @@ -43,25 +38,43 @@ We use a combination of Access tokens and Webhooks to authenticate and sync chan
<Frame>
<img src="/images/gitlab/gitlab-project-access-token.png" />
</Frame>
</Step>

<Step title="Create the webhook">
a. Navigate to your GitLab's project `Settings` > `Webhooks`.
</Step>
<Step title="Set up the connection">
Within the [Mintlify dashboard](https://dashboard.mintlify.com/mintlify/mintlify/settings/deployment/git-settings), add the project ID and access token from the previous steps alongside the other configurations. Click "Save Changes" when you're done.
<Frame>
<img src="/images/gitlab/gitlab-config.png" />
</Frame>
</Step>
</Steps>

b. In the "URL" field, enter the endpoint `https://leaves.mintlify.com/gitlab-webhook`
## Create the webhook

c. Name the webhook "Mintlify".
Webhooks allow us to receive events when changes are made so that we can
automatically trigger deployments.

d. Paste the Webhook token generated after completing the previous steps.
<Steps>
<Step title="Navigate to Settings > Webhooks and click 'Add new Webhook'">
<Frame>
<img src="/images/gitlab/gitlab-show-webtoken.png" />
<img src="/images/gitlab/gitlab-webhook.png" />
</Frame>
</Step>
<Step title="Set up URL and webhook">
In the "URL" field, enter the endpoint `https://leaves.mintlify.com/gitlab-webhook` and name the webhook "Mintlify".

e. Select the events you want to trigger the webhook:
- Push events (All branches)
- Merge requests events

f. Click `Add webhook`.
</Step>
<Step title="Paste token">
Paste the Webhook token generated after setting up the connection.
<Frame>
<img src="/images/gitlab/gitlab-show-webtoken.png" />
</Frame>
</Step>
<Step title="Select events">
Select the events you want to trigger the webhook:
- Push events (All branches)
- Merge requests events
When you're done it should look like this:
<Frame>
<img src="/images/gitlab/gitlab-project-webtoken.png" />
</Frame>
Expand All @@ -77,12 +90,13 @@ We use a combination of Access tokens and Webhooks to authenticate and sync chan
<Frame>
<img src="/images/gitlab/gitlab-project-webtoken-test.png" />
</Frame>

</Step>
</Steps>

<Note>
Reach out to the Mintlify team if you need help.
Contact us [here](https://mintlify.com/enterprise).
Reach out to the Mintlify team if you need help. Contact us
[here](https://mintlify.com/enterprise).
</Note>

[git-settings]: https://dashboard.mintlify.com/settings/deployment/git-settings

0 comments on commit a211f79

Please sign in to comment.