Skip to content
代码片段 群组 项目
未验证 提交 004862d6 编辑于 作者: Rémy Coutable's avatar Rémy Coutable
浏览文件

ci: Dry up main .gitlab-ci.yml file


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
上级 77f5ab30
No related branches found
No related tags found
无相关合并请求
......@@ -24,6 +24,18 @@ default:
# Default job timeout set to 90m https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/10520
timeout: 90m
.ruby3-variables: &ruby3-variables
RUBY_VERSION: "3.0"
OMNIBUS_GITLAB_RUBY3_BUILD: "true"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3"
.ruby2-variables: &ruby2-variables
RUBY_VERSION: "2.7"
.default-branch-incident-variables: &default-branch-incident-variables
CREATE_INCIDENT_FOR_PIPELINE_FAILURE: "true"
NOTIFY_PIPELINE_FAILURE_CHANNEL: "master-broken"
workflow:
name: '$PIPELINE_NAME'
rules:
......@@ -41,67 +53,56 @@ workflow:
# For merge requests running exclusively in Ruby 2.7
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby2/'
variables:
RUBY_VERSION: "2.7"
<<: *ruby2-variables
PIPELINE_NAME: 'Ruby 2 $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline'
# For (detached) merge request pipelines.
- if: '$CI_MERGE_REQUEST_IID'
variables:
RUBY_VERSION: "3.0"
OMNIBUS_GITLAB_RUBY3_BUILD: "true"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3"
<<: *ruby3-variables
PIPELINE_NAME: 'Ruby 3 $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline'
# For the scheduled pipelines, we set specific variables.
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"'
variables:
RUBY_VERSION: "3.0"
OMNIBUS_GITLAB_RUBY3_BUILD: "true"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3"
<<: *ruby3-variables
<<: *default-branch-incident-variables
CRYSTALBALL: "true"
CREATE_INCIDENT_FOR_PIPELINE_FAILURE: "true"
NOTIFY_PIPELINE_FAILURE_CHANNEL: "master-broken"
PIPELINE_NAME: 'Scheduled $CI_COMMIT_BRANCH pipeline'
# Run pipelines for ruby2 branch
- if: '$CI_COMMIT_BRANCH == "ruby2" && $CI_PIPELINE_SOURCE == "schedule"'
variables:
RUBY_VERSION: "2.7"
<<: *ruby2-variables
NOTIFY_PIPELINE_FAILURE_CHANNEL: "f_ruby3"
PIPELINE_NAME: 'Scheduled ruby 2 pipeline'
# This work around https://gitlab.com/gitlab-org/gitlab/-/issues/332411 whichs prevents usage of dependency proxy
# when pipeline is triggered by a project access token.
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $GITLAB_USER_LOGIN =~ /project_\d+_bot\d*/'
variables:
RUBY_VERSION: "3.0"
OMNIBUS_GITLAB_RUBY3_BUILD: "true"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3"
<<: *ruby3-variables
<<: *default-branch-incident-variables
GITLAB_DEPENDENCY_PROXY_ADDRESS: ""
CREATE_INCIDENT_FOR_PIPELINE_FAILURE: "true"
NOTIFY_PIPELINE_FAILURE_CHANNEL: "master-broken"
# For `$CI_DEFAULT_BRANCH` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
variables:
RUBY_VERSION: "3.0"
OMNIBUS_GITLAB_RUBY3_BUILD: "true"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3"
CREATE_INCIDENT_FOR_PIPELINE_FAILURE: "true"
NOTIFY_PIPELINE_FAILURE_CHANNEL: "master-broken"
<<: *ruby3-variables
<<: *default-branch-incident-variables
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
variables:
RUBY_VERSION: "2.7"
<<: *ruby2-variables
# If `$GITLAB_INTERNAL` isn't set, don't create a pipeline.
- if: '$GITLAB_INTERNAL == null'
when: never
# For stable, auto-deploy, and security branches, create a pipeline.
- if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable(-ee)?$/'
variables:
RUBY_VERSION: "2.7"
<<: *ruby2-variables
NOTIFY_PIPELINE_FAILURE_CHANNEL: "releases"
- if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
variables:
RUBY_VERSION: "2.7"
<<: *ruby2-variables
- if: '$CI_COMMIT_BRANCH =~ /^security\//'
variables:
RUBY_VERSION: "2.7"
<<: *ruby2-variables
variables:
PG_VERSION: "12"
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册