FIX 重构ci流程

This commit is contained in:
Jasder
2020-08-20 18:37:53 +08:00
parent 89b2e263ae
commit 7c1ab2cddf
34 changed files with 207 additions and 54 deletions

View File

@@ -0,0 +1,15 @@
json.id build.build_id
json.repo_id build.build_repo_id
json.number build.build_number
json.status build.build_status
json.event build.build_event
json.action build.build_action
# json.link build.build_link
json.message build.build_message
json.author build.build_author
json.started format_utc_time build.build_started
json.finished format_utc_time build.build_finished
json.created format_utc_time build.build_created
json.updated format_utc_time build.build_updated
json.version build.build_version
json.duration_time render_duartion_time(build.build_finished, build.build_started)

View File

@@ -0,0 +1,22 @@
json.id stage.stage_id
json.repo_id stage.stage_repo_id
json.build_id stage.stage_build_id
json.name stage.stage_name
json.kind stage.stage_kind
json.type stage.stage_type
json.number stage.stage_number
json.status stage.stage_status
json.errignore stage.stage_errignore
json.exit_code stage.stage_exit_code
json.os stage.stage_os
json.arch stage.stage_arch
json.started format_utc_time(stage.stage_started)
json.stopped format_utc_time(stage.stage_stoped)
json.created format_utc_time(stage.stage_created)
json.updated format_utc_time(stage.stage_updated)
json.version stage.stage_version
json.on_success stage.stage_on_success
json.on_failure stage.stage_on_failure
json.steps build.steps do |stage|
json.partial! "/ci/builds/step", step: step
end

View File

@@ -0,0 +1,8 @@
json.id step.step_id
json.number step.step_number
json.name step.step_name
json.status step.step_status
json.exit_code step.step_exit_code
json.started format_utc_time(step.step_started)
json.stopped format_utc_time(step.step_stopped)
json.version step.build_version

View File

@@ -0,0 +1,4 @@
json.total_count @total_count
json.builds @builds do |build|
json.partial! "/ci/builds/build", build: build
end

View File

@@ -0,0 +1,4 @@
json.partial! "/ci/builds/build", build: @build
json.stages @build.stages do |stage|
json.partial! "/ci/builds/stage", stage: stage
end

View File

@@ -0,0 +1,6 @@
json.array! @languages do |lang|
json.id lang.id
json.name lang.name
json.content render_base64_decoded lang.content
json.cover_url lang.cover_id.present? ? download_url(lang.cover) : nil
end

View File

@@ -0,0 +1,6 @@
json.array! @languages do |lang|
json.id lang.id
json.name lang.name
json.content render_base64_decoded lang.content
json.cover_url lang.cover_id.present? ? download_url(lang.cover) : nil
end

View File

@@ -0,0 +1,4 @@
json.id @language.id
json.name @language.name
json.content render_base64_decoded @language.content
json.cover_url @language.cover_id.present? ? download_url(@language.cover) : nil