mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-10 06:49:49 +08:00
流水线增加用户字段
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
class Ci::PipelinesController < ApplicationController
|
||||
class Ci::PipelinesController < Ci::BaseController
|
||||
|
||||
before_action :require_login, only: %i[list create]
|
||||
skip_before_action :connect_to_ci_db
|
||||
|
||||
# ======流水线相关接口========== #
|
||||
def list
|
||||
@pipelines = Ci::Pipeline.all
|
||||
@pipelines = Ci::Pipeline.where('login=?', current_user.login)
|
||||
end
|
||||
|
||||
def create
|
||||
ActiveRecord::Base.transaction do
|
||||
pipeline = Ci::Pipeline.new(pipeline_name: params[:pipeline_name], file_name: params[:file_name])
|
||||
pipeline = Ci::Pipeline.new(pipeline_name: params[:pipeline_name], file_name: params[:file_name], login: current_user.login)
|
||||
pipeline.save!
|
||||
|
||||
# 默认创建四个初始阶段
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# pipeline_status :string(50) default("unknown"), not null
|
||||
# login :string(255)
|
||||
#
|
||||
|
||||
class Ci::Pipeline < Ci::LocalBase
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
#
|
||||
# Table name: ci_templates
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# template_name :string(255) not null
|
||||
# stage_type :string(255) not null
|
||||
# category :string(255) not null
|
||||
# content :text(65535) not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# id :integer not null, primary key
|
||||
# template_name :string(255) not null
|
||||
# stage_type :string(255) not null
|
||||
# category :string(255) not null
|
||||
# content :text(65535) not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# parent_category :string(255)
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
||||
5
db/migrate/20210118011710_add_login_to_ci_pipelines.rb
Normal file
5
db/migrate/20210118011710_add_login_to_ci_pipelines.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddLoginToCiPipelines < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :ci_pipelines, :login, :string
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user