debian-mirror-gitlab/app/helpers/ci/jobs_helper.rb

49 lines
1.8 KiB
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
module Ci
module JobsHelper
def jobs_data
{
"endpoint" => project_job_path(@project, @build, format: :json),
"project_path" => @project.full_path,
2020-11-24 15:15:51 +05:30
"artifact_help_url" => help_page_path('user/gitlab_com/index.html', anchor: 'gitlab-cicd'),
2021-11-18 22:05:49 +05:30
"deployment_help_url" => help_page_path('user/project/clusters/deploy_to_cluster.html', anchor: 'troubleshooting'),
2020-07-28 23:09:34 +05:30
"runner_settings_url" => project_runners_path(@build.project, anchor: 'js-runners-settings'),
"page_path" => project_job_path(@project, @build),
"build_status" => @build.status,
"build_stage" => @build.stage,
"log_state" => '',
2021-01-29 00:20:46 +05:30
"build_options" => javascript_build_options,
2021-06-08 01:23:25 +05:30
"retry_outdated_job_docs_url" => help_page_path('ci/pipelines/settings', anchor: 'retry-outdated-jobs'),
"code_quality_help_url" => help_page_path('user/project/merge_requests/code_quality', anchor: 'troubleshooting')
2020-07-28 23:09:34 +05:30
}
end
2021-04-29 21:17:54 +05:30
2022-03-02 08:16:31 +05:30
def bridge_data(build, project)
2022-01-26 12:08:38 +05:30
{
2022-03-02 08:16:31 +05:30
"build_id" => build.id,
"empty-state-illustration-path" => image_path('illustrations/job-trigger-md.svg'),
"pipeline_iid" => build.pipeline.iid,
"project_full_path" => project.full_path
2022-01-26 12:08:38 +05:30
}
end
2021-04-29 21:17:54 +05:30
def job_counts
{
"all" => limited_counter_with_delimiter(@all_builds),
"pending" => limited_counter_with_delimiter(@all_builds.pending),
"running" => limited_counter_with_delimiter(@all_builds.running),
"finished" => limited_counter_with_delimiter(@all_builds.finished)
}
end
def job_statuses
statuses = Ci::HasStatus::AVAILABLE_STATUSES
statuses.to_h { |status| [status, status.upcase] }
end
2020-07-28 23:09:34 +05:30
end
end
2021-06-08 01:23:25 +05:30
Ci::JobsHelper.prepend_mod_with('Ci::JobsHelper')