GitLab CI Integration

Monday, May 27, 2024
console integrations GitLab

gitlab

The Phase Console now natively integrates with GitLab CI, allowing you to sync secrets and variables to your GitLab CI pipelines and jobs. You can sync secrets to both groups and projects. We've also added the ability to use self-hosted GitLab instances to authenticate with the Phase Console.


Setting up syncing with GitLab CI

To start syncing secrets to GitLab CI, you'll need to create an access token in GitLab and add it as an authentication mode in Phase Console under Integrations. The access token can be scoped to a single user, a group, or an entire instance if you are self-hosting GitLab. You can find detailed instructions for setting up GitLab authentication credentials in the docs.

create credentials

Your GitLab instance host url (or just https://gitlab.com if using GitLab cloud) and the access token are all that's required to set up authentication in Phase.

input gitlab credentials

To set up a sync with GitLab CI, you can choose an Environment and Path in your Phase App as the source of secrets. Next, you'll need to choose a GitLab project or Group as the destination to sync secrets to. You can also choose to either Protect or Mask secrets when they are synced to GitLab. Protected secrets will only be available to pipelines that run on protected branches or protected tags on GitLab. Masked secrets' values are masked in GitLab job logs, but must meet strict masking criteria as per GitLab's requirements.

create sync

Once setup, Phase will automatically sync your secrets to GitLab whenever you create, update or delete a secret in the selected Environment and path.

gitlab syncs

You can keep track of sync jobs from the Syncing tab of your App and view detailed logs and metadata for each job. You can also pause and resume a specific sync job if needed, or trigger syncs manually.

You can find complete documentation for setting up and managing GitLab CI integration in the Phase Docs.


Authentication with self-hosted GitLab

We've also added support for setting up self-hosted GitLab instances as an authentication mode for users self-hosting the Phase Console. You'll simply need to supply the GITLAB_AUTH_URL environment variable to your Phase Console instance, and set up GitLab authentication as normal. Read the self-hosting docs for more information on setting up authentication for the Phase Console.


GitLab CI integration and support for self-hosted GitLab auth is available in Phase Console v2.26.0

Reach out on Slack or GitHub for any questions or feedback on this release!

CLOUD

The fastest and easiest way to get started with Phase. Spin up an app in minutes. Hosted in Frankfurt 🇩🇪

SELF-HOSTED

Run Phase on your own infrastructure and maintain full control. Perfect for customers with strict compliance requirements.