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>2020-02-06 12:09:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 12:09:06 +0300
commitd87918510a866a5fcbbc2f899ad65c6938ebf5f5 (patch)
tree3c864a44f28dc17bcba2bcea30e49e0c08bd0582 /lib/gitlab/database_importers
parentfa478f189009649b115136957e2da30d760fe391 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/database_importers')
-rw-r--r--lib/gitlab/database_importers/self_monitoring/project/create_service.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
index 49adc93fdc8..ef2e4055c62 100644
--- a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
+++ b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
@@ -15,6 +15,7 @@ module Gitlab
:create_group,
:create_project,
:save_project_id,
+ :create_environment,
:add_prometheus_manual_configuration,
:track_event
@@ -80,6 +81,17 @@ module Gitlab
end
end
+ def create_environment(result)
+ environment = ::Environment.new(project_id: result[:project].id, name: 'production')
+
+ if environment.save
+ success(result)
+ else
+ log_error("Could not create environment for the Self monitoring project. Errors: %{errors}" % { errors: environment.errors.full_messages })
+ error(_('Could not create environment'))
+ end
+ end
+
def add_prometheus_manual_configuration(result)
return success(result) unless prometheus_enabled?
return success(result) unless prometheus_listen_address.present?