GitLab
Integrating with a VCS provider unlocks the ability to use GitOps workflows, import modules, enable Open Policy Agent, and much more.
Before working through the authentication flow, the user who does the authentication needs at least the maintainer
role in Gitlab to be able to pull back the repositories into Scalr.
To enable GitLab, go to the "Integrations" page at the account scope and select GitLab or Gitlab Enterprise (on-prem). Enter the provider name and, for Enterprise, the URL.
Copy the callback URL, click the “register a new OAuth application” link, and register a new OAuth app in Gitlab. Enable the following permissions in the application configuration:
- Confidential
- api
- read_repository
- profile
For Gitlab Enterprise check these options in the network settings (Admin Area):
- Allow requests to the local network from webhooks and services
- Allow requests to the local network from system hooks
Save and then copy the Application ID and Secret:
Go back to Scalr, enter the Id and secret. Upon clicking “create” a redirection back to Gitlab occurs to complete the authorization.
Pull Request Comments
Scalr will automatically kick off a dry run (plan only) when a merge request is opened against a branch that is linked to a Scalr workspace, commonly referred to GitOps automation. Scalr will then send information back to GitLab in the form of comments, if "Send the plan summary back to pull request comments" is checked in the GitLab integration within Scalr:
The result will be an overall summary of the merge request as well as a per-workspace report showing what resources have been created, updated, or deleted as well as any logs for failed runs:
Scalr will also update the comments with the apply results after the run has finished. There is a separate checkbox, "Send the apply summary back to PR comments", that must be enabled for this to work.
Updated 22 days ago