gitlab-org--gitlab-foss/app/helpers/auto_devops_helper.rb

30 lines
1 KiB
Ruby
Raw Normal View History

2017-09-05 09:39:19 -04:00
module AutoDevopsHelper
def show_auto_devops_callout?(project)
Feature.get(:auto_devops_banner_disabled).off? &&
show_callout?('auto_devops_settings_dismissed') &&
2017-09-07 07:23:05 -04:00
can?(current_user, :admin_pipeline, project) &&
project.has_auto_devops_implicitly_disabled? &&
!project.repository.gitlab_ci_yml &&
!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
2017-09-19 13:43:23 -04:00
_('Auto Review Apps and Auto Deploy need a domain name and the %{kubernetes} to work correctly.') % params
else
2017-09-19 13:43:23 -04:00
_('Auto Review Apps and Auto Deploy need the %{kubernetes} to work correctly.') % params
end
elsif missing_domain
_('Auto Review Apps and Auto Deploy need a domain name to work correctly.')
end
end
end