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

Use a variable to control where to fetch repo


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
上级 6125d5a6
No related branches found
No related tags found
无相关合并请求
......@@ -155,6 +155,7 @@ variables:
GIT_STRATEGY: "clone"
GIT_SUBMODULE_STRATEGY: "none"
GET_SOURCES_ATTEMPTS: "3"
CI_FETCH_REPO_GIT_STRATEGY: "none"
DEBIAN_VERSION: "bullseye"
UBI_VERSION: "8.6"
CHROME_VERSION: "113"
......
......@@ -22,6 +22,14 @@
- !reference [.default-utils-before_script, before_script]
- source scripts/prepare_build.sh
.repo-from-artifacts:
variables:
GIT_STRATEGY: "${CI_FETCH_REPO_GIT_STRATEGY}"
needs:
# If the job extending this also defines `needs`, make sure to update
# its `needs` to include `clone-gitlab-repo` because it'll be overridden.
- clone-gitlab-repo
.production:
variables:
RAILS_ENV: "production"
......
......@@ -616,6 +616,7 @@ rspec:predictive:trigger:
artifacts: true
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
GIT_STRATEGY: $GIT_STRATEGY
trigger:
strategy: depend
forward:
......@@ -1269,6 +1270,7 @@ rspec-foss-impact:trigger:
artifacts: true
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
GIT_STRATEGY: $GIT_STRATEGY
trigger:
strategy: depend
forward:
......
......@@ -24,6 +24,10 @@ dont-interrupt-me:
.base-rspec-foss-impact:
extends: .rspec-base-pg14-as-if-foss
needs:
<% if repo_from_artifacts %>
- pipeline: $PARENT_PIPELINE_ID
job: clone-gitlab-repo
<% end %>
- pipeline: $PARENT_PIPELINE_ID
job: detect-tests
- pipeline: $PARENT_PIPELINE_ID
......
......@@ -23,6 +23,10 @@ dont-interrupt-me:
.base-predictive:
needs:
<% if repo_from_artifacts %>
- pipeline: $PARENT_PIPELINE_ID
job: clone-gitlab-repo
<% end %>
- pipeline: $PARENT_PIPELINE_ID
job: detect-tests
- pipeline: $PARENT_PIPELINE_ID
......
......@@ -2784,6 +2784,10 @@
- when: manual
allow_failure: true
.setup:rules:clone-gitlab-repo:
rules:
- if: '$CI_FETCH_REPO_GIT_STRATEGY == "none"'
.setup:rules:gitlab_git_test:
rules:
- <<: *if-merge-request-labels-pipeline-expedite
......
......@@ -46,7 +46,7 @@ dont-interrupt-me:
clone-gitlab-repo:
extends:
- .absolutely-predictive-job
# rules: [when: never] # Uncomment this to clone instead of using artifacts
- .setup:rules:clone-gitlab-repo
stage: sync
script:
- echo OK
......@@ -57,14 +57,6 @@ clone-gitlab-repo:
- '*'
expire_in: '12 hours'
.repo-from-artifacts:
variables:
GIT_STRATEGY: none
needs:
# If the job extending this also defines `needs`, make sure to update
# its `needs` to include `clone-gitlab-repo` because it'll be overridden.
- clone-gitlab-repo
gitlab_git_test:
extends:
- .predictive-job
......
......@@ -93,7 +93,8 @@ def all_rspec_files
def erb_binding
{
rspec_files_per_test_level: rspec_files_per_test_level,
test_suite_prefix: test_suite_prefix
test_suite_prefix: test_suite_prefix,
repo_from_artifacts: ENV['CI_FETCH_REPO_GIT_STRATEGY'] == 'none'
}
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册