diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-03 21:51:55 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-07-07 09:33:17 +0300 |
commit | 5b0954759cc24bdba97be89bb117c5440174f859 (patch) | |
tree | 0a60ceec84548de35910a46edd149be23d831f35 /app/views/ci/variables | |
parent | 49430c47d4d34072ff43cc1e35213317802055d7 (diff) |
Basic BE change
Fix static-snalysis
Move the precedence of group secure variable before project secure variable. Allow project_id to be null.
Separate Ci::VariableProject and Ci::VariableGroup
Add the forgotton files
Add migration file to update type of ci_variables
Fix form_for fpr VariableProject
Fix test
Change the table structure according to the yorik advice
Add necessary migration files. Remove unnecessary migration spec.
Revert safe_model_attributes.yml
Fix models
Fix spec
Avoid self.variable. Use becomes for correct routing.
Use unique index on group_id and key
Add null: false for t.timestamps
Fix schema version
Rename VariableProject and VariableGroup to ProjectVariable and GroupVariable
Rename the rest of them
Add the rest of files
Basic BE change
Fix static-snalysis
Move the precedence of group secure variable before project secure variable. Allow project_id to be null.
Separate Ci::VariableProject and Ci::VariableGroup
Add the forgotton files
Add migration file to update type of ci_variables
Fix form_for fpr VariableProject
Fix test
Change the table structure according to the yorik advice
Add necessary migration files. Remove unnecessary migration spec.
Revert safe_model_attributes.yml
Fix models
Fix spec
Avoid self.variable. Use becomes for correct routing.
Use unique index on group_id and key
Add null: false for t.timestamps
Fix schema version
Rename VariableProject and VariableGroup to ProjectVariable and GroupVariable
Rename the rest of them
Add the rest of files
Implement CURD
Rename codes related to VariableGroup and VariableProject FE part
Remove unneccesary changes
Make Fe code up-to-date
Add protected flag to migration file
Protected group variables essential package
Update schema
Improve doc
Fix logic and spec for models
Fix logic and spec for controllers
Fix logic and spec for views(pre feature)
Add feature spec
Fixed bugs. placeholder. reveal button. doc.
Add changelog
Remove unnecessary comment
godfat nice catches
Improve secret_variables_for arctecture
Fix spec
Fix StaticAnlysys & path_regex spec
Revert "Improve secret_variables_for arctecture"
This reverts commit c3216ca212322ecf6ca534cb12ce75811a4e77f1.
Use ayufan suggestion for secret_variables_for
Use find instead of find_by
Fix spec message for variable is invalid
Fix spec remove variable.group_id = group.id
godffat spec nitpicks
Use include Gitlab::Routing.url_helpers for presenter spec
Diffstat (limited to 'app/views/ci/variables')
-rw-r--r-- | app/views/ci/variables/_content.html.haml | 9 | ||||
-rw-r--r-- | app/views/ci/variables/_form.html.haml | 19 | ||||
-rw-r--r-- | app/views/ci/variables/_index.html.haml | 16 | ||||
-rw-r--r-- | app/views/ci/variables/_show.html.haml | 9 | ||||
-rw-r--r-- | app/views/ci/variables/_table.html.haml | 28 |
5 files changed, 81 insertions, 0 deletions
diff --git a/app/views/ci/variables/_content.html.haml b/app/views/ci/variables/_content.html.haml new file mode 100644 index 00000000000..98f618ca3b8 --- /dev/null +++ b/app/views/ci/variables/_content.html.haml @@ -0,0 +1,9 @@ +%h4.prepend-top-0 + Secret variables + = link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'secret-variables'), target: '_blank' +%p + These variables will be set to environment by the runner, and could be protected by exposing only to protected branches or tags. +%p + So you can use them for passwords, secret keys or whatever you want. +%p + The value of the variable can be visible in job log if explicitly asked to do so. diff --git a/app/views/ci/variables/_form.html.haml b/app/views/ci/variables/_form.html.haml new file mode 100644 index 00000000000..eebd0955c80 --- /dev/null +++ b/app/views/ci/variables/_form.html.haml @@ -0,0 +1,19 @@ += form_for @variable, as: :variable, url: @variable.form_path do |f| + = form_errors(@variable) + + .form-group + = f.label :key, "Key", class: "label-light" + = f.text_field :key, class: "form-control", placeholder: @variable.placeholder, required: true + .form-group + = f.label :value, "Value", class: "label-light" + = f.text_area :value, class: "form-control", placeholder: @variable.placeholder + .form-group + .checkbox + = f.label :protected do + = f.check_box :protected + %strong Protected + .help-block + This variable will be passed only to pipelines running on protected branches and tags + = link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'protected-secret-variables'), target: '_blank' + + = f.submit btn_text, class: "btn btn-save" diff --git a/app/views/ci/variables/_index.html.haml b/app/views/ci/variables/_index.html.haml new file mode 100644 index 00000000000..007c2344b5a --- /dev/null +++ b/app/views/ci/variables/_index.html.haml @@ -0,0 +1,16 @@ +.row.prepend-top-default.append-bottom-default + .col-lg-4 + = render "ci/variables/content" + .col-lg-8 + %h5.prepend-top-0 + Add a variable + = render "ci/variables/form", btn_text: "Add new variable" + %hr + %h5.prepend-top-0 + Your variables (#{@variables.size}) + - if @variables.empty? + %p.settings-message.text-center.append-bottom-0 + No variables found, add one with the form above. + - else + = render "ci/variables/table" + %button.btn.btn-info.js-btn-toggle-reveal-values{ "data-status" => 'hidden' } Reveal Values diff --git a/app/views/ci/variables/_show.html.haml b/app/views/ci/variables/_show.html.haml new file mode 100644 index 00000000000..2bfb290629d --- /dev/null +++ b/app/views/ci/variables/_show.html.haml @@ -0,0 +1,9 @@ +- page_title "Variables" + +.row.prepend-top-default.append-bottom-default + .col-lg-3 + = render "ci/variables/content" + .col-lg-9 + %h5.prepend-top-0 + Update variable + = render "ci/variables/form", btn_text: "Save variable" diff --git a/app/views/ci/variables/_table.html.haml b/app/views/ci/variables/_table.html.haml new file mode 100644 index 00000000000..71a0b56c4f4 --- /dev/null +++ b/app/views/ci/variables/_table.html.haml @@ -0,0 +1,28 @@ +.table-responsive.variables-table + %table.table + %colgroup + %col + %col + %col + %col{ width: 100 } + %thead + %th Key + %th Value + %th Protected + %th + %tbody + - @variables.each do |variable| + - if variable.id? + %tr + %td.variable-key= variable.key + %td.variable-value{ "data-value" => variable.value }****** + %td.variable-protected= Gitlab::Utils.boolean_to_yes_no(variable.protected) + %td.variable-menu + = link_to variable.edit_path, class: "btn btn-transparent btn-variable-edit" do + %span.sr-only + Update + = icon("pencil") + = link_to variable.delete_path, class: "btn btn-transparent btn-variable-delete", method: :delete, data: { confirm: "Are you sure?" } do + %span.sr-only + Remove + = icon("trash") |