Commit a3726b6c authored by John Jarvis's avatar John Jarvis

Merge branch 'jts/fixup-auto-deploy-branch-creation' into 'master'

Complete the setup for auto deploy branches

Closes gitlab-org/release/framework#287 and gitlab-org/release/framework#288

See merge request !597
parents b0c1f977 7c9bc260
......@@ -14,11 +14,13 @@ module ReleaseTools
def create_auto_deploy_branches!
# Find passing commits before creating branches
ref_deployer = latest_successful_ref(Project::Deployer, gitlab_ops_client)
ref_ce = latest_successful_ref(Project::GitlabCe)
ref_ee = latest_successful_ref(Project::GitlabEe)
ref_omnibus = latest_successful_ref(Project::OmnibusGitlab)
# Deployer uses ops.gitlab.net as the source for all branches
create_branch_from_ref(Project::Deployer, branch_name, ref_deployer, gitlab_ops_client)
create_branch_from_ref(Project::GitlabCe, branch_name, ref_ce)
create_branch_from_ref(Project::GitlabEe, branch_name, ref_ee)
create_branch_from_ref(Project::OmnibusGitlab, branch_name, ref_omnibus)
update_auto_deploy_ci
......@@ -31,7 +33,7 @@ module ReleaseTools
end
def branch_name
"#{version}-auto-deploy-#{@pipeline_id}-ee"
"#{version}-auto-deploy-#{@pipeline_id}"
end
def update_auto_deploy_ci
......
......@@ -23,26 +23,32 @@ describe ReleaseTools::Services::AutoDeployBranchService do
describe '#create_auto_deploy_branches!', :silence_stdout do
it 'creates auto-deploy branches for gitlab-ee and gitlab-ce' do
expect(ReleaseTools::Commits).to receive(:new).and_return(branch_commit).exactly(3).times
branch_name = '11-10-auto-deploy-0009000'
expect(ReleaseTools::Commits).to receive(:new).and_return(branch_commit).exactly(4).times
expect(internal_client_ops).to receive(:create_branch).with(
branch_name,
'1234',
ReleaseTools::Project::Deployer
)
expect(internal_client).to receive(:create_branch).with(
'11-10-auto-deploy-0009000-ee',
branch_name,
'1234',
ReleaseTools::Project::OmnibusGitlab
ReleaseTools::Project::GitlabCe
)
expect(internal_client).to receive(:create_branch).with(
'11-10-auto-deploy-0009000-ee',
branch_name,
'1234',
ReleaseTools::Project::GitlabEe
)
expect(internal_client_ops).to receive(:create_branch).with(
'11-10-auto-deploy-0009000-ee',
expect(internal_client).to receive(:create_branch).with(
branch_name,
'1234',
ReleaseTools::Project::Deployer
ReleaseTools::Project::OmnibusGitlab
)
expect(internal_client).to receive(:update_variable).with(
'gitlab-org/release-tools',
'AUTO_DEPLOY_BRANCH',
'11-10-auto-deploy-0009000-ee'
branch_name
)
without_dry_run do
service.create_auto_deploy_branches!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment