diff options
Diffstat (limited to '.gitlab')
-rw-r--r-- | .gitlab/ci/global.gitlab-ci.yml | 8 | ||||
-rw-r--r-- | .gitlab/ci/rails.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | .gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb | 4 | ||||
-rw-r--r-- | .gitlab/ci/rails/rspec-predictive.gitlab-ci.yml.erb | 4 | ||||
-rw-r--r-- | .gitlab/ci/rails/shared.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | .gitlab/ci/rules.gitlab-ci.yml | 4 | ||||
-rw-r--r-- | .gitlab/ci/setup.gitlab-ci.yml | 10 |
7 files changed, 24 insertions, 10 deletions
diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index dc006a3ce24..798bcacb367 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -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" diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index fd4047373d7..ad5da0048f9 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -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: diff --git a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb index 8a36848b363..97abb26ae7f 100644 --- a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb +++ b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb @@ -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 diff --git a/.gitlab/ci/rails/rspec-predictive.gitlab-ci.yml.erb b/.gitlab/ci/rails/rspec-predictive.gitlab-ci.yml.erb index ddcb335d0dd..90f1b6fc5a8 100644 --- a/.gitlab/ci/rails/rspec-predictive.gitlab-ci.yml.erb +++ b/.gitlab/ci/rails/rspec-predictive.gitlab-ci.yml.erb @@ -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 diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml index 2492b8f69dd..aa5b7c33385 100644 --- a/.gitlab/ci/rails/shared.gitlab-ci.yml +++ b/.gitlab/ci/rails/shared.gitlab-ci.yml @@ -67,7 +67,7 @@ include: extends: - .rails-job-base - .base-artifacts - # - .repo-from-artifacts # Comment this to clone instead of using artifacts + - .repo-from-artifacts # Comment this to clone instead of using artifacts stage: test variables: RUBY_GC_MALLOC_LIMIT: 67108864 diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 31b4dda4368..f2f0d2f4775 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -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 diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index 934ddd2bffe..15f36957392 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -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 |