流水线创建修改

This commit is contained in:
victor 2021-01-27 16:27:56 +08:00
parent e1ddad5040
commit 2c648b7941
1 changed files with 15 additions and 14 deletions

View File

@ -70,6 +70,7 @@ class Ci::PipelinesController < Ci::BaseController
# 在drone数据库repo表新增一条repo记录
def create_ci_repo(pipeline)
if pipeline.branch != 'master'
create_params = {
repo_user_id: @ci_user.user_id,
repo_namespace: @project.owner.login,
@ -82,15 +83,15 @@ class Ci::PipelinesController < Ci::BaseController
repo = Ci::Repo.create_repo(create_params)
repo
end
nil
end
def get_pipeline_file_sha(file_name, branch)
file_path_uri = URI.parse(file_name)
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: branch || 'master')
if interactor.success?
file = interactor.result
return file['sha']
else
return nil
file['sha']
end
end