Multiple Omni models can share the same git repository. If you’re connecting a model to a repository that’s already connected to another model, you only need to complete the Omni-side setup—the repository’s deploy key and webhooks are already configured.
Requirements
To follow the steps in this guide, you’ll need:- Omni Connection Admin permissions for the model you want to connect to git
- An existing repository
- Permissions in that allow you to:
Setup
Retrieve the repository's SSH URL
- In your browser, navigate to the GitLab repository you want to connect to Omni.
- Click the Code button.
- In the modal that displays, locate the SSH option.
Connect the repository to Omni
- In Omni, click Develop.
- Click the model you want to connect to git.
- In the model IDE, click Model > Git settings.
- You’ll be prompted to enter connection details for the repository:
- Git Provider - Select from the dropdown.
- SSH URL - Copy and paste the repository’s SSH URL from Step 1.
- Base Branch - Enter the name of the default branch for the repository. Omni will default to
mainunless a different name is specified.
- Click Configure Git.
Add a repository deploy key
- Create a project deploy key for the GitLab repository by following GitLab’s documentation.
- Fill in the deploy key fields as follows:
- Title - Enter a descriptive title to help you identify what the key is used for. For example, Omni Snowflake Model
- Key - Copy the Public key from the Omni Git settings page and paste it into this field.
- Grant write permissions to this key - Check this box, which will allow Omni to push changes made in Omni to the repository
- Click Add key.
Add repository webhooks
- The repository settings page should still be open in GitLab. If not, re-open it.
- Click Webhooks.
- Click Add new webhook.
- Fill in the fields as follows:
- URL - From the Omni Git settings page, copy the Payload URL and paste it into this field.
- Secret token - From the Omni Git settings page, copy the Webhook secret and paste it into this field.
- In the Custom headers section:
- Click Add custom header.
- In the Header name field, enter
Content_type. - In the Header value field, enter
application/json.
- In the Trigger section, select Merge request events.
- When finished, click Add webhook.