Skip to content

Commit

Permalink
🦊 Add moar gitlab steps for self-servicing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mxbaylee committed Oct 11, 2024
1 parent 119c6ff commit 5715d3d
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 10 deletions.
Binary file modified images/gitlab/gitlab-project-access-token.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 modified images/gitlab/gitlab-project-id.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-project-webtoken-test.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-project-webtoken.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-show-webtoken.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 61 additions & 10 deletions settings/gitlab.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,81 @@ icon: 'gitlab'
GitLab integration is available on the [Enterprise plan](https://mintlify.com/pricing).
</Check>

<Steps>
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.

<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>

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

a. Navigate to your project's `Settings` > `Access Tokens`.
<Step title="Generate an Access token">
a. Navigate to your GitLab's project `Settings` > `Access Tokens`.

b. Select `Add new token`.
1. Name the token "Mintlify" - this specific name is important as it will be visible when we make changes on our end.
2. Choose `read_api` for the scopes.
3. If you have a private repo, you must set the role as `Reporter`.
1. Name the token "Mintlify".
2. If you have a private repo, you must set the role as `Maintainer`.
3. Choose `api` and `read_api` for the scopes.

c. Finally click `Create project access token` and copy the token.

<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`.

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

c. Name the webhook "Mintlify".

d. Paste the Webhook token generated after completing the previous steps.
<Frame>
<img src="/images/gitlab/gitlab-show-webtoken.png" />
</Frame>

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

f. Click `Add webhook`.
<Frame>
<img src="/images/gitlab/gitlab-project-webtoken.png" />
</Frame>
</Step>
<Step title="Reach out to the Mintlify team for final setup.">
Contact us [here](https://mintlify.com/enterprise).
<Step title="Test the Webhook">
After creating the Webhook:

a. Click the "Test" dropdown and select "Push events" to send a sample payload to ensure it's configured correctly.

b. Check your Mintlify dashboard to view the status of your GitLab integration and confirm that the test event was received successfully.

This will help you verify that everything is working correctly and that your documentation will sync properly with your GitLab repository.
<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).
</Note>

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

0 comments on commit 5715d3d

Please sign in to comment.