Markdown

GitLab: credentials

Under Connections, category Git, you connect GitLab.com or a self-hosted instance via OAuth or a personal access token so MainPath can create or import groups and projects there.

On this page

GitLab lives under Connections in the Git category. Connect with GitLab (OAuth against GitLab.com) is recommended. Otherwise store a personal access token; that also covers self-hosted instances.

On the project, choose GitLab at the bottom instead of Automatically generated when application repositories should live on GitLab.com (or your instance). The GitOps repo is created in that same group. MainPath tenant IaC stays in the MainPath GitLab group.

OAuth (GitLab.com)

  1. Open Connections → GitLab → Connect with GitLab.
  2. Sign in and grant api so MainPath can manage projects, files, and CI variables.
  3. After the callback the connection is available.

OAuth requires GITLAB_OAUTH_CLIENT_ID / GITLAB_OAUTH_CLIENT_SECRET on the backend. If the app is missing, use a token.

Personal access token

  1. In GitLab, under Preferences → Access Tokens (or Group → Access Tokens), create a token with api.
  2. Open Connections → GitLab → Add API token.
  3. Enter Name, Slug, token, GitLab URL (https://gitlab.com or your instance), and optionally the group path.

Pipelines on GitLab.com

MainPath writes .gitlab-ci.yml that includes the public pipeline library doppelt-digital/app-project-pipelines plus templates-common/hosted-runner.yml. Jobs run on GitLab-hosted Linux and macOS runners (saas-linux-small-amd64, saas-macos-medium-m1) with ASDF instead of Tart.

Container images go to the container registry of that same GitLab instance (registry.gitlab.com/<group>/<repo> on GitLab.com, otherwise <host>:5050/...). GitOps pulls from there, not from the MainPath registry. MainPath creates a group deploy token with read_registry for those pulls; without group rights GitOps falls back to the OAuth or API token (docker login as user oauth2). The GitOps repo lives in that same GitLab group (<group>/gitops). Ansible, SOPS/OpenBao and the SSH tunnel run in that repo’s hosted CI. Application pipelines write image tags there (GITOPS_CONFIGURATION_* on the app projects, GITOPS_DEPLOY_ENABLED). Put GITOPS_BOT_* only on the GitOps project, not on app repos — otherwise update-version calls gitlab.com with the wrong token. mp clone fetches application and GitOps repos from that GitLab group.

Thank you for your request

We have received your request and will get back to you as soon as possible.

Would you like to talk to us directly?

Choose a time here for an introductory call with Robin.

Open the calendar in a new tab