diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-02 18:10:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-02 18:10:19 +0300 |
commit | cef74ed0434b53fde0d7dcc2507b6f1639a63e7d (patch) | |
tree | 300bc30b6c4272cba3ab65297ede18bfffba2bd2 /scripts | |
parent | ecdd26856c46b1e9e0c500701b36b6ae338e18a0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/setup/generate-as-if-foss-env.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/setup/generate-as-if-foss-env.rb b/scripts/setup/generate-as-if-foss-env.rb new file mode 100755 index 00000000000..68b869287a6 --- /dev/null +++ b/scripts/setup/generate-as-if-foss-env.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'gitlab' +require 'set' + +client = Gitlab.client(endpoint: ENV['CI_API_V4_URL'], private_token: '') + +rspec_jobs = Set.new + +client.pipeline_jobs(ENV['CI_PROJECT_ID'], ENV['CI_PIPELINE_ID']).auto_paginate do |job| + rspec_type = job.name[/^rspec ([\w\-]+)/, 1] + + rspec_jobs << rspec_type if rspec_type +end + +puts 'START_AS_IF_FOSS=true', "RUBY_VERSION=#{ENV['RUBY_VERSION']}" +puts 'ENABLE_RSPEC=true' if rspec_jobs.any? + +rspec_jobs.each do |rspec| + puts "ENABLE_RSPEC_#{rspec.upcase.tr('-', '_')}=true" +end |