forgeplus/app/models/ci/pipeline.rb

30 lines
1.1 KiB
Ruby
Raw Normal View History

2021-01-12 10:23:26 +08:00
# == Schema Information
#
# Table name: ci_pipelines
#
# id :integer not null, primary key
# pipeline_name :string(255) not null
# pipeline_status :string(255) default("unknown"), not null
2021-01-12 10:23:26 +08:00
# file_name :string(255) not null
# created_at :datetime not null
# updated_at :datetime not null
2021-01-18 09:32:23 +08:00
# login :string(255)
2021-01-19 11:10:47 +08:00
# sync :integer default("0"), not null
2021-02-02 16:42:48 +08:00
# identifier :string(255)
2021-01-26 17:15:53 +08:00
# branch :string(255)
# event :string(255)
# sha :string(255)
2021-02-02 16:42:48 +08:00
# owner :string(255)
2021-01-12 10:23:26 +08:00
#
class Ci::Pipeline < Ci::LocalBase
validates :pipeline_name, presence: {message: "流水线名称不能为空"}
validates :file_name, presence: {message: "流水线文件名称不能为空"}
2021-01-19 14:00:22 +08:00
validates :identifier, presence: {message: "项目identifier不能为空"}
2021-01-12 10:23:26 +08:00
has_many :pipeline_stages, -> { reorder(show_index: :asc) }, foreign_key: "pipeline_id", :class_name => 'Ci::PipelineStage', dependent: :destroy
2021-01-26 17:15:53 +08:00
attr_accessor :last_build_time
2021-01-12 10:23:26 +08:00
end