构建流水线yaml,保存和更新 log

This commit is contained in:
xxq250 2024-05-23 09:51:04 +08:00
parent 2b7414c2fc
commit 15513718f9
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
tip_exception("流水线yaml内空不能为空") if pipeline_yaml.blank? tip_exception("流水线yaml内空不能为空") if pipeline_yaml.blank?
@pipeline.yaml = pipeline_yaml @pipeline.yaml = pipeline_yaml
sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch)
Rails.logger.info "sha==========#{sha}"
Rails.logger.info "sha==========#{sha.present?}"
interactor = sha.present? ? Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) : Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) interactor = sha.present? ? Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) : Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params)
tip_exception(interactor.error) unless interactor.success? tip_exception(interactor.error) unless interactor.success?
render_ok render_ok