|
|
|
@@ -35,7 +35,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController |
|
|
|
sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) |
|
|
|
interactor = sha.present? ? Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("update").merge(sha: sha)) : Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("create")) |
|
|
|
tip_exception(interactor.error) unless interactor.success? |
|
|
|
render_ok({ pipeline_yaml: pipeline_yaml }) |
|
|
|
file = interactor.result |
|
|
|
render_ok({ pipeline_yaml: pipeline_yaml, pipeline_name: params[:pipeline_name], file_name: @pipeline.file_name, sha: file['content']['sha'] }) |
|
|
|
end |
|
|
|
|
|
|
|
def build_yaml |
|
|
|
@@ -61,7 +62,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController |
|
|
|
sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) |
|
|
|
interactor = Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("create").merge(sha: sha)) |
|
|
|
tip_exception(interactor.error) unless interactor.success? |
|
|
|
render_ok |
|
|
|
file = interactor.result |
|
|
|
render_ok({ pipeline_yaml: pipeline_yaml, pipeline_name: params[:pipeline_name], file_name: @pipeline.file_name, sha: file['content']['sha'] }) |
|
|
|
end |
|
|
|
|
|
|
|
def destroy |
|
|
|
|