流水线创建修改
This commit is contained in:
parent
e1ddad5040
commit
2c648b7941
|
@ -70,6 +70,7 @@ class Ci::PipelinesController < Ci::BaseController
|
||||||
|
|
||||||
# 在drone数据库repo表新增一条repo记录
|
# 在drone数据库repo表新增一条repo记录
|
||||||
def create_ci_repo(pipeline)
|
def create_ci_repo(pipeline)
|
||||||
|
if pipeline.branch != 'master'
|
||||||
create_params = {
|
create_params = {
|
||||||
repo_user_id: @ci_user.user_id,
|
repo_user_id: @ci_user.user_id,
|
||||||
repo_namespace: @project.owner.login,
|
repo_namespace: @project.owner.login,
|
||||||
|
@ -82,15 +83,15 @@ class Ci::PipelinesController < Ci::BaseController
|
||||||
repo = Ci::Repo.create_repo(create_params)
|
repo = Ci::Repo.create_repo(create_params)
|
||||||
repo
|
repo
|
||||||
end
|
end
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
def get_pipeline_file_sha(file_name, branch)
|
def get_pipeline_file_sha(file_name, branch)
|
||||||
file_path_uri = URI.parse(file_name)
|
file_path_uri = URI.parse(file_name)
|
||||||
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: branch || 'master')
|
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: branch || 'master')
|
||||||
if interactor.success?
|
if interactor.success?
|
||||||
file = interactor.result
|
file = interactor.result
|
||||||
return file['sha']
|
file['sha']
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue