Create recommendation how to configure GitLab-org projects for CI use
TL;DR
We should document how to configure GitLab CI for all GitLab-org owned and managed projects.
The reason for doing that is:
- ease contributing to GitLab-org codebase and make it also free to our contributors
- reduce cost of running GitLab-org infrastructure
- provide more capacity and more consistent capacity on a general purpose runners, as us would not be fighting for resources as other projects
- provide consistent experience for us, GitLab-org
Place
This issue is created in www-gitlab-com
as this current seems to be the most appropriate place for it.
For example we could extend the section Basics of GitLab Development where we would add a section for internal CI usage
. This seems to somehow
aligned with this to be a common place for such information. However, feel free to move it around if needed.
Proposal
Following my comment from: https://gitlab.com/gitlab-org/gitlab/-/issues/210571#note_313834867
We document the usage of the following tags:
-
gitlab-org
: to indicate a Runner that does not require Docker and can be run efficiently -
gitlab-org-docker
: to indicate a Runner that does require Docker -
gitlab-org-windows
: to indicate a Runner that does require Windows (in the future)
We document the default .gitlab-ci.yml
template to be:
workflow:
rules:
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == "master"'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
default:
tags:
- gitlab-org
This defines a default workflow to be using MR pipelines
. This defines the gitlab-org
to be used by default which is cost-optimised non-docker enabled Runner.
We document that if job requires the usage of Docker
or Windows
(in the future) it needs to be properly annotated and defined only in the context of the specific job:
sast:
tags:
- gitlab-org-docker