流水线pipeline_type
This commit is contained in:
parent
ffa4c6e870
commit
ec13987023
|
@ -87,6 +87,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
|
||||||
@pipeline.file_name = ".gitea/workflows/#{@pipeline.pipeline_name}.yml"
|
@pipeline.file_name = ".gitea/workflows/#{@pipeline.pipeline_name}.yml"
|
||||||
@pipeline.branch = params[:branch] || @project.default_branch
|
@pipeline.branch = params[:branch] || @project.default_branch
|
||||||
@pipeline.is_graphic_design = params[:pipeline_type] == 2 ? true : false
|
@pipeline.is_graphic_design = params[:pipeline_type] == 2 ? true : false
|
||||||
|
@pipeline.pipeline_type = params[:pipeline_type] if params[:pipeline_type].present?
|
||||||
@pipeline.save!
|
@pipeline.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,4 @@ class Action::Pipeline < ApplicationRecord
|
||||||
validates :pipeline_name, presence: { message: "不能为空" }
|
validates :pipeline_name, presence: { message: "不能为空" }
|
||||||
validates :json, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
validates :json, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||||
validates :yaml, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
validates :yaml, length: { maximum: 65535, too_long: "不能超过65535个字符"}
|
||||||
|
|
||||||
def pipeline_type
|
|
||||||
self.is_graphic_design? ? 2 : 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
json.status 0
|
json.status 0
|
||||||
json.message "success"
|
json.message "success"
|
||||||
json.extract! @pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design,
|
json.extract! @pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, :pipeline_type,
|
||||||
:repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at
|
:repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at
|
||||||
# json.project
|
|
|
@ -1,5 +1,4 @@
|
||||||
json.status 0
|
json.status 0
|
||||||
json.message "success"
|
json.message "success"
|
||||||
json.extract! @pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design,
|
json.extract! @pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, :pipeline_type,
|
||||||
:repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at
|
:repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at
|
||||||
# json.project
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddPipelinesType < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :action_pipelines, :pipeline_type, :integer, :default => 1
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue