forked from Gitlink/forgeplus
同步工厂优化过的流水线代码,语法暂不验证
This commit is contained in:
parent
20ba9d9ac7
commit
2c7d76b682
|
|
@ -115,10 +115,10 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
|
||||||
@pipeline.pipeline_name = params[:pipeline_name] if params[:pipeline_name].present?
|
@pipeline.pipeline_name = params[:pipeline_name] if params[:pipeline_name].present?
|
||||||
pipeline_yaml = params[:pipeline_yaml].present? ? params[:pipeline_yaml] : build_pipeline_yaml_new(@pipeline.pipeline_name, params[:pipeline_json])
|
pipeline_yaml = params[:pipeline_yaml].present? ? params[:pipeline_yaml] : build_pipeline_yaml_new(@pipeline.pipeline_name, params[:pipeline_json])
|
||||||
tip_exception("流水线yaml内空不能为空") if pipeline_yaml.blank?
|
tip_exception("流水线yaml内空不能为空") if pipeline_yaml.blank?
|
||||||
result = validate_string(pipeline_yaml, @pipeline.branch, @project.default_branch)
|
# result = validate_string(pipeline_yaml, @pipeline.branch, @project.default_branch)
|
||||||
unless result[:valid]
|
# unless result[:valid]
|
||||||
tip_exception(result[:errors].join(","))
|
# tip_exception(result[:errors].join(","))
|
||||||
end
|
# end
|
||||||
@pipeline.yaml = pipeline_yaml
|
@pipeline.yaml = pipeline_yaml
|
||||||
#Rails.logger.info "pipeline_yaml base64=========================#{Base64.encode64(@pipeline.yaml).gsub(/\n/, '')}"
|
#Rails.logger.info "pipeline_yaml base64=========================#{Base64.encode64(@pipeline.yaml).gsub(/\n/, '')}"
|
||||||
sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch)
|
sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch)
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ module Api::ActionValidatorHelper
|
||||||
Rails.logger.info "data==true#{data[true]}"
|
Rails.logger.info "data==true#{data[true]}"
|
||||||
if data[true]
|
if data[true]
|
||||||
if data[true]['push']
|
if data[true]['push']
|
||||||
unless data[true]['push'].key?('branches')
|
# unless data[true]['push'].key?('branches')
|
||||||
errors << "push触发器缺少branches配置"
|
# errors << "push触发器缺少branches配置"
|
||||||
end
|
# end
|
||||||
|
#
|
||||||
unless data[true]['push'].key?('paths-ignore')
|
# unless data[true]['push'].key?('paths-ignore')
|
||||||
errors << "push触发器缺少paths-ignore配置"
|
# errors << "push触发器缺少paths-ignore配置"
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
if data[true]['schedule'] && branch != default_branch
|
if data[true]['schedule'] && branch != default_branch
|
||||||
errors << "只有#{default_branch}分支支持定时触发器"
|
errors << "只有#{default_branch}分支支持定时触发器"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue