mirror of
https://github.com/czhu12/canine.git
synced 2026-05-12 06:39:10 -05:00
added better logging for builds & deploys
This commit is contained in:
@@ -16,5 +16,14 @@ class Avo::Resources::Build < Avo::BaseResource
|
||||
field :git_sha, as: :text
|
||||
field :commit_sha, as: :text
|
||||
field :commit_message, as: :text, format_using: -> { value.truncate 30 }
|
||||
|
||||
field :logs, as: :code, language: "shell", theme: "dracula" do
|
||||
lines = record.log_outputs.order(:created_at).pluck(:output).map { |o| o.gsub(/\e\[\d+m/, "") }
|
||||
if view == :show
|
||||
lines.join("\n")
|
||||
else
|
||||
lines.last(20).join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,5 +6,14 @@ class Avo::Resources::Deployment < Avo::BaseResource
|
||||
field :created_at, as: :date_time
|
||||
field :updated_at, as: :date_time
|
||||
field :project, as: :belongs_to
|
||||
|
||||
field :logs, as: :code, language: "shell", theme: "dracula" do
|
||||
lines = record.log_outputs.order(:created_at).pluck(:output).map { |o| o.gsub(/\e\[\d+m/, "") }
|
||||
if view == :show
|
||||
lines.join("\n")
|
||||
else
|
||||
lines.last(20).join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user