Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-01 00:06:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-01 00:06:28 +0300
commit8f210aebe1d740e8ee194f171f1f33a6e1fba313 (patch)
treef43c545801bb96fd0737f18493fb30ab92972627 /scripts/static-analysis
parent996f700997805b3590da8d8afdd19d193989078a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/static-analysis')
-rwxr-xr-xscripts/static-analysis38
1 files changed, 28 insertions, 10 deletions
diff --git a/scripts/static-analysis b/scripts/static-analysis
index 602cd847a71..b7f7100c365 100755
--- a/scripts/static-analysis
+++ b/scripts/static-analysis
@@ -26,17 +26,35 @@ def emit_errors(static_analysis)
end
end
-tasks = [
- %w[bin/rake lint:all],
- %w[bundle exec license_finder],
- %w[yarn run eslint],
- %w[yarn run stylelint],
- %w[yarn run prettier-all],
- %w[bundle exec rubocop --parallel],
- %w[scripts/lint-conflicts.sh],
- %w[scripts/lint-rugged]
-]
+def jobs_to_run(node_index, node_total)
+ all_tasks = [
+ %w[bin/rake lint:all],
+ %w[bundle exec license_finder],
+ %w[yarn run eslint],
+ %w[yarn run stylelint],
+ %w[yarn run prettier-all],
+ %w[bundle exec rubocop --parallel],
+ %w[scripts/lint-conflicts.sh],
+ %w[scripts/lint-rugged]
+ ]
+ case node_total
+ when 1
+ all_tasks
+ when 2
+ rake_lint_all, *rest_jobs = all_tasks
+ case node_index
+ when 1
+ [rake_lint_all]
+ else
+ rest_jobs
+ end
+ else
+ raise "Parallelization > 2 (currently set to #{node_total}) isn't supported yet!"
+ end
+end
+
+tasks = jobs_to_run((ENV['CI_NODE_INDEX'] || 1).to_i, (ENV['CI_NODE_TOTAL'] || 1).to_i)
static_analysis = Gitlab::Popen::Runner.new
static_analysis.run(tasks) do |cmd, &run|