forked from Gitlink/forgeplus
查询阶段返回流水线名称
This commit is contained in:
parent
2d99713cd0
commit
c6aeecb33c
|
@ -72,6 +72,7 @@ class Ci::PipelinesController < Ci::BaseController
|
|||
# =========阶段相关接口========= #
|
||||
def stages
|
||||
pipeline_id = params[:id]
|
||||
@pipeline_name = Ci::Pipeline.find(pipeline_id).pipeline_name
|
||||
@pipeline_stages = Ci::PipelineStage.where('pipeline_id=?', pipeline_id).order('show_index asc')
|
||||
end
|
||||
|
||||
|
@ -171,8 +172,7 @@ class Ci::PipelinesController < Ci::BaseController
|
|||
steps.each do |step|
|
||||
pipeline_stage_step = Ci::PipelineStageStep.find(step[:id])
|
||||
if pipeline_stage_step
|
||||
pipeline_stage_step.update(step_name: step[:step_name], content: step[:content],
|
||||
show_index: step[:show_index], template_id: step[:template_id])
|
||||
pipeline_stage_step.update(step_name: step[:step_name], content: step[:content], template_id: step[:template_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ json.id pipeline_stage.id
|
|||
json.stage_name pipeline_stage.stage_name
|
||||
json.stage_type pipeline_stage.stage_type
|
||||
json.pipeline_id pipeline_stage.pipeline_id
|
||||
json.pipeline_name pipeline_name
|
||||
json.show_index pipeline_stage.show_index
|
||||
json.created_at pipeline_stage.created_at
|
||||
json.updated_at pipeline_stage.updated_at
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
json.stages @pipeline_stages do |pipeline_stage|
|
||||
json.partial! "/ci/pipeline_stages/list", pipeline_stage: pipeline_stage
|
||||
json.partial! "/ci/pipeline_stages/list", pipeline_stage: pipeline_stage, pipeline_name: @pipeline_name
|
||||
end
|
Loading…
Reference in New Issue