In order to integrate with GitLab, you need to have a GitLab user with Maintainer/Owner permissions on the necessary GitLab Project. We highly recommend that the user would be a designated shared bot user, as env0 would perform actions as this user on the project/repository.
If you do not have those permissions, please ask an admin or a different user with those permissions to create the template.
If you would like to create the first GitLab Integrated Template in this env0 organization, please see Create Your First Template instead.
- Click ADD A NEW TEMPLATE on the top right in the Templates screen.
- Pick your template type, enter a name for the template, and then click on NEXT
- Click on the GitLab.com button. Since you have already created a GitLab template in this env0 organization, there is no need for further authentication with Gitlab.
- Pick which user you want to authenticate as, out of the users in your organization that have already authorised the env0 GitLab app. After picking the user, you'll be able to pick a project from the GitLab Projects accessible to that user.
- If you would like to pull the code from a specific revision or branch, enter that in the
Revisionfield. Leaving this field empty will use your default branch, which is usually “master”/"main".
- Enter the folder your Terraform files are located in under
Terraform Folder. If your Terraform files are in the root of the repository, leave this empty.
- Click on NEXT to proceed to the variables section
- Add environment and terraform variables that you'd like to be used during deployment, and then click on NEXT to go to the final "Projects" section
- Pick the projects that you'd like to have access to deploy this template, and then click on DONE to create the template.
- Can't find your repository? Check if your Authorized User has access to the necessary GitLab project. In order to authorize as a new GitLab user, please log out of GitLab on your browser, and then click on "authorize another GitLab user"
If you would like to integrate an existing template with GitLab:
- Go to the Templates screen, and click on Settings for the template you would like to integrate with GitLab.
- Click on the VCS step. From there you can click on the GitLab.com button, and integrate with GitLab as you would for a new template.
Updated 4 months ago