summaryrefslogtreecommitdiff
path: root/app/views/projects/_form.html.haml
blob: f04ca331d8dd8de45bf09fc138b4ea6e9e27832e (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
= nested_form_for @project, html: { class: 'form-horizontal' } do |f|
  - if @project.errors.any?
    #error_explanation
      %p.lead= "#{pluralize(@project.errors.count, "error")} prohibited this project from being saved:"
      .alert.alert-error
        %ul
          - @project.errors.full_messages.each do |msg|
            %li= msg

  %fieldset
    %legend Build settings
    .form-group
      = label_tag nil, class: 'control-label' do
        Get code
      .col-sm-10
        %p Get recent application code using the following command:
        .radio
          = label_tag do
            = f.radio_button :allow_git_fetch, 'false'
            %strong git clone
            .light Slower but makes sure you have a clean dir before every build
        .radio
          = label_tag do
            = f.radio_button :allow_git_fetch, 'true'
            %strong git fetch
            .light Faster
    .form-group
      = f.label :timeout_in_minutes, 'Timeout', class: 'control-label'
      .col-sm-10
        = f.number_field :timeout_in_minutes, class: 'form-control', min: '0'
        .light per build in minutes


  %fieldset
    %legend Build Schedule
    .form-group
      = f.label :always_build, 'Schedule build', class: 'control-label'
      .col-sm-10
        .checkbox
          = f.label :always_build do
            = f.check_box :always_build
            %span.light Repeat last build after X hours if no builds
    .form-group
      = f.label :polling_interval, "Build interval", class: 'control-label'
      .col-sm-10
        = f.number_field :polling_interval, placeholder: '5', min: '0', class: 'form-control'
        .light In hours

  %fieldset
    %legend Project settings
    .form-group
      = f.label :default_ref, "Make tabs for the following branches", class: 'control-label'
      .col-sm-10
        = f.text_field :default_ref, class: 'form-control', placeholder: 'master, stable'
        .light You will be able to filter builds by the following branches
    .form-group
      = f.label :public, 'Public mode', class: 'control-label'
      .col-sm-10
        .checkbox
          = f.label :public do
            = f.check_box :public
            %span.light Anyone can see project and builds
    .form-group
      = f.label :shared_runners_enabled, 'Allow shared runners', class: 'control-label'
      .col-sm-10
        .checkbox
          = f.label :shared_runners_enabled do
            = f.check_box :shared_runners_enabled
            %span.light Allow run builds on shared runners
    .form-group
      = f.label :coverage_regex, "Test coverage parsing", class: 'control-label'
      .col-sm-10
        .input-group
          %span.input-group-addon /
          = f.text_field :coverage_regex, class: 'form-control', placeholder: '\(\d+.\d+\%\) covered'
          %span.input-group-addon /
        .light We will use this regular expression to find test coverage output in build trace. Leave blank if you want to disable this feature
        .bs-callout.bs-callout-info
          %p Below are examples of regex for existing tools:
          %ul
            %li
              Simplecov (Ruby) -
              %code \(\d+.\d+\%\) covered
            %li
              pytest-cov (Python) -
              %code \d+\%$



  %fieldset
    %legend Advanced settings
    .form-group
      = f.label :name, class: 'control-label'
      .col-sm-10
        = f.text_field :name, class: 'form-control', placeholder: 'my-project'
    .form-group
      = f.label :gitlab_url, "GitLab url to project", class: 'control-label'
      .col-sm-10
        = f.text_field :gitlab_url, class: 'form-control', placeholder: 'http://gitlab.domain.com/project-slug'
    .form-group
      = f.label :gitlab_id, "GitLab project id", class: 'control-label'
      .col-sm-10
        = f.text_field :gitlab_id, class: 'form-control', placeholder: '17'
    .form-group
      = f.label :token, "CI token", class: 'control-label'
      .col-sm-10
        = f.text_field :token, class: 'form-control', placeholder: 'xEeFCaDAB89'
    .form-group
      = f.label :url, "CI project URL", class: 'control-label'
      .col-sm-10
        = text_field_tag :url, project_url(@project), class: 'form-control', readonly: true
    .form-group
      = f.label :skip_refs, "Skip refs", class: 'control-label'
      .col-sm-10
        = f.text_field :skip_refs, class: 'form-control', placeholder: 'branch1, branch2, feature/*'
        .light
          You can specify git references to skip CI builds. Accepts strings and glob pattern syntax

  .form-actions
    = f.submit 'Save changes', class: 'btn btn-save'
    = link_to 'Cancel', projects_path, class: 'btn'
    - unless @project.new_record?
      = link_to 'Remove Project', project_path(@project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger pull-right'