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:
Diffstat (limited to 'Dangerfile')
-rw-r--r--Dangerfile20
1 files changed, 15 insertions, 5 deletions
diff --git a/Dangerfile b/Dangerfile
index 212097f6a68..ca729f1b941 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -2,14 +2,24 @@
require 'gitlab-dangerfiles'
-gitlab_dangerfiles = Gitlab::Dangerfiles::Engine.new(self)
-gitlab_dangerfiles.import_plugins
+def ee?
+ # Support former project name for `dev` and support local Danger run
+ %w[gitlab gitlab-ee].include?(ENV['CI_PROJECT_NAME']) || Dir.exist?(File.expand_path('ee', __dir__))
+end
-return if helper.release_automation?
+project_name = ee? ? 'gitlab' : 'gitlab-foss'
-danger.import_plugin('danger/plugins/*.rb')
+Gitlab::Dangerfiles.for_project(self, project_name) do |gitlab_dangerfiles|
+ gitlab_dangerfiles.import_plugins
-gitlab_dangerfiles.import_dangerfiles
+ unless helper.release_automation?
+ danger.import_plugin('danger/plugins/*.rb')
+ gitlab_dangerfiles.import_dangerfiles(except: %w[simple_roulette])
+ gitlab_dangerfiles.config.files_to_category = ProjectHelper::CATEGORIES
+ end
+end
+
+return if helper.release_automation?
project_helper.rule_names.each do |rule|
danger.import_dangerfile(path: File.join('danger', rule))