summaryrefslogtreecommitdiff
path: root/app/views/projects/settings/ci_cd/_autodevops_form.html.haml
blob: 5ec5a06396efe299bfac2569a13cec5be117f24e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.row
  .col-lg-12
    = form_for @project, url: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings') do |f|
      = form_errors(@project)
      %fieldset.builds-feature.js-auto-devops-settings
        .form-group
          - message = auto_devops_warning_message(@project)
          - if message
            %p.auto-devops-warning-message.settings-message.text-center
              = message.html_safe
          = f.fields_for :auto_devops_attributes, @auto_devops do |form|
            .card.auto-devops-card
              .card-body
                .form-check
                  = form.check_box :enabled, class: 'form-check-input js-toggle-extra-settings', checked: @project.auto_devops_enabled?
                  = form.label :enabled, class: 'form-check-label' do
                    %strong= s_('CICD|Default to Auto DevOps pipeline')
                    - if @project.has_auto_devops_implicitly_enabled?
                      %span.badge.badge-info.js-instance-default-badge= s_('CICD|instance enabled')
                  .form-text.text-muted
                    = s_('CICD|The Auto DevOps pipeline will run if no alternative CI configuration file is found.')
                    = link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank'
              .card-footer.js-extra-settings{ class: @project.auto_devops_enabled? || 'hidden' }
                = form.label :domain do
                  %strong= _('Domain')
                = form.text_field :domain, class: 'form-control', placeholder: 'domain.com'
                .form-text.text-muted
                  = s_('CICD|You need to specify a domain if you want to use Auto Review Apps and Auto Deploy stages.')
                  - if cluster_ingress_ip = cluster_ingress_ip(@project)
                    = s_('%{nip_domain} can be used as an alternative to a custom domain.').html_safe % { nip_domain: "<code>#{cluster_ingress_ip}.nip.io</code>".html_safe }
                  = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'auto-devops-base-domain'), target: '_blank'

                %label.prepend-top-10
                  %strong= s_('CICD|Deployment strategy')
                %p.settings-message.text-center
                  = s_('CICD|Deployment strategy needs a domain name to work correctly.')
                .form-check
                  = form.radio_button :deploy_strategy, 'continuous', class: 'form-check-input'
                  = form.label :deploy_strategy_continuous, class: 'form-check-label' do
                    = s_('CICD|Continuous deployment to production')
                    = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'auto-deploy'), target: '_blank'

                .form-check
                  = form.radio_button :deploy_strategy, 'timed_incremental', class: 'form-check-input'
                  = form.label :deploy_strategy_timed_incremental, class: 'form-check-label' do
                    = s_('CICD|Continuous deployment to production using timed incremental rollout')
                    = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'timed-incremental-rollout-to-production'), target: '_blank'

                .form-check
                  = form.radio_button :deploy_strategy, 'manual', class: 'form-check-input'
                  = form.label :deploy_strategy_manual, class: 'form-check-label' do
                    = s_('CICD|Automatic deployment to staging, manual deployment to production')
                    = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'incremental-rollout-to-production'), target: '_blank'

          = f.submit _('Save changes'), class: "btn btn-success prepend-top-15"