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:
authorbokebilly <fobio@gitlab.com>2017-09-16 16:02:37 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-09-19 16:32:31 +0300
commit3017697701eaecd301edfbc2e4f7c865456f1b0f (patch)
treeb5d4e52c5de0c42929f145607efdb1972d5949fa /app/helpers
parent4c6c105909ea610eac760b05e66d9efc57cbb43c (diff)
Add warning message if domain or cluster are not configured
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/auto_devops_helper.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/helpers/auto_devops_helper.rb b/app/helpers/auto_devops_helper.rb
index c455d18cff8..5da68a2d03d 100644
--- a/app/helpers/auto_devops_helper.rb
+++ b/app/helpers/auto_devops_helper.rb
@@ -5,6 +5,25 @@ module AutoDevopsHelper
can?(current_user, :admin_pipeline, project) &&
project.has_auto_devops_implicitly_disabled? &&
!project.repository.gitlab_ci_yml &&
- project.ci_services.active.none?
+ !project.ci_service
+ end
+
+ def auto_devops_warning_message(project)
+ missing_domain = !project.auto_devops&.has_domain?
+ missing_service = !project.kubernetes_service&.active?
+
+ if missing_service
+ params = {
+ kubernetes: link_to('Kubernetes service', edit_project_service_path(project, 'kubernetes'))
+ }
+
+ if missing_domain
+ _('Auto Review Apps and Auto Deploy need a domain name and the %s to work correctly.') % params
+ else
+ _('Auto Review Apps and Auto Deploy need the %s to work correctly.') % params
+ end
+ elsif missing_domain
+ _('Auto Review Apps and Auto Deploy need a domain name to work correctly.')
+ end
end
end