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:
Diffstat (limited to 'app/views/projects/ci')
-rw-r--r--app/views/projects/ci/builds/_build.html.haml6
-rw-r--r--app/views/projects/ci/lints/_create.html.haml77
-rw-r--r--app/views/projects/ci/lints/_lint_warnings.html.haml6
-rw-r--r--app/views/projects/ci/lints/show.html.haml8
4 files changed, 66 insertions, 31 deletions
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 4c20ac84b24..23f9a6a8f6c 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -97,7 +97,7 @@
%td
.float-right
- if can?(current_user, :read_build, job) && job.artifacts?
- = link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: _('Download artifacts'), class: 'btn btn-build' do
+ = link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: _('Download artifacts'), class: 'btn btn-build gl-button btn-icon btn-svg' do
= sprite_icon('download')
- if can?(current_user, :update_build, job)
- if job.active?
@@ -126,5 +126,5 @@
= link_to play_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Play'), class: 'btn btn-build' do
= custom_icon('icon_play')
- elsif job.retryable?
- = link_to retry_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Retry'), class: 'btn btn-build' do
- = icon('repeat')
+ = link_to retry_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Retry'), class: 'btn btn-build gl-button btn-icon btn-default' do
+ = sprite_icon('repeat', css_class: 'gl-icon')
diff --git a/app/views/projects/ci/lints/_create.html.haml b/app/views/projects/ci/lints/_create.html.haml
index d65c06aa2a4..5cc89343ba3 100644
--- a/app/views/projects/ci/lints/_create.html.haml
+++ b/app/views/projects/ci/lints/_create.html.haml
@@ -4,6 +4,8 @@
%b= _("Status:")
= _("syntax is correct")
+ = render "projects/ci/lints/lint_warnings", warnings: @warnings
+
.table-holder
%table.table.table-bordered
%thead
@@ -11,33 +13,54 @@
%th= _("Parameter")
%th= _("Value")
%tbody
- - @stages.each do |stage|
- - @builds.select { |build| build[:stage] == stage }.each do |build|
- - job = @jobs[build[:name].to_sym]
- %tr
- %td #{stage.capitalize} Job - #{build[:name]}
- %td
- %pre= job[:before_script].to_a.join('\n')
- %pre= job[:script].to_a.join('\n')
- %pre= job[:after_script].to_a.join('\n')
+ - if @dry_run
+ - @stages.each do |stage|
+ - stage.statuses.each do |job|
+ %tr
+ %td #{stage.name.capitalize} Job - #{job.name}
+ %td
+ %pre= job.options[:before_script].to_a.join('\n')
+ %pre= job.options[:script].to_a.join('\n')
+ %pre= job.options[:after_script].to_a.join('\n')
+ %br
+ %b= _("Tag list:")
+ = job.tag_list.to_a.join(", ") if job.is_a?(Ci::Build)
+ %br
+ %b= _("Environment:")
+ = job.options.dig(:environment, :name)
+ %br
+ %b= _("When:")
+ = job.when
+ - if job.allow_failure
+ %b= _("Allowed to fail")
- %br
- %b= _("Tag list:")
- = build[:tag_list].to_a.join(", ")
- %br
- %b= _("Only policy:")
- = job[:only].to_a.join(", ")
- %br
- %b= _("Except policy:")
- = job[:except].to_a.join(", ")
- %br
- %b= _("Environment:")
- = build[:environment]
- %br
- %b= _("When:")
- = build[:when]
- - if build[:allow_failure]
- %b= _("Allowed to fail")
+ - else
+ - @stages.each do |stage|
+ - @builds.select { |build| build[:stage] == stage }.each do |build|
+ - job = @jobs[build[:name].to_sym]
+ %tr
+ %td #{stage.capitalize} Job - #{build[:name]}
+ %td
+ %pre= job[:before_script].to_a.join('\n')
+ %pre= job[:script].to_a.join('\n')
+ %pre= job[:after_script].to_a.join('\n')
+ %br
+ %b= _("Tag list:")
+ = build[:tag_list].to_a.join(", ")
+ %br
+ %b= _("Only policy:")
+ = job[:only].to_a.join(", ")
+ %br
+ %b= _("Except policy:")
+ = job[:except].to_a.join(", ")
+ %br
+ %b= _("Environment:")
+ = build[:environment]
+ %br
+ %b= _("When:")
+ = build[:when]
+ - if build[:allow_failure]
+ %b= _("Allowed to fail")
- else
.bs-callout.bs-callout-danger
@@ -47,3 +70,5 @@
%pre
- @errors.each do |message|
%p= message
+
+ = render "projects/ci/lints/lint_warnings", warnings: @warnings
diff --git a/app/views/projects/ci/lints/_lint_warnings.html.haml b/app/views/projects/ci/lints/_lint_warnings.html.haml
new file mode 100644
index 00000000000..0a5bb8f76ef
--- /dev/null
+++ b/app/views/projects/ci/lints/_lint_warnings.html.haml
@@ -0,0 +1,6 @@
+- if warnings
+ - warnings.each do |warning|
+ .bs-callout.bs-callout-warning
+ %p
+ %b= _("Warning:")
+ = markdown(warning)
diff --git a/app/views/projects/ci/lints/show.html.haml b/app/views/projects/ci/lints/show.html.haml
index 7b87664961e..0c51c978bfe 100644
--- a/app/views/projects/ci/lints/show.html.haml
+++ b/app/views/projects/ci/lints/show.html.haml
@@ -3,7 +3,7 @@
- content_for :library_javascripts do
= page_specific_javascript_tag('lib/ace.js')
-%h2.pt-3.pb-3= _("Check your .gitlab-ci.yml")
+%h2.pt-3.pb-3= _("Validate your GitLab CI configuration")
.project-ci-linter
= form_tag project_ci_lint_path(@project), method: :post do
@@ -15,8 +15,12 @@
#ci-editor.ci-editor= @content
= text_area_tag(:content, @content, class: 'hidden form-control span1', rows: 7, require: true)
.col-sm-12
- .float-left.prepend-top-10
+ .float-left.gl-mt-3
= submit_tag(_('Validate'), class: 'btn btn-success submit-yml')
+ - if Gitlab::Ci::Features.lint_creates_pipeline_with_dry_run?(@project)
+ = check_box_tag(:dry_run, 'true', params[:dry_run])
+ = label_tag(:dry_run, _('Simulate a pipeline created for the default branch'))
+ = link_to icon('question-circle'), help_page_path('ci/lint', anchor: 'pipeline-simulation'), target: '_blank', rel: 'noopener noreferrer'
.float-right.prepend-top-10
= button_tag(_('Clear'), type: 'button', class: 'btn btn-default clear-yml')