Skip to content
Snippets Groups Projects
Commit 4eae0015 authored by Balasankar 'Balu' C's avatar Balasankar 'Balu' C
Browse files

Merge branch 'jts/fix-pre-deployment' into 'master'

parents 6c3c5c10 1af75ed4
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
class Info class Info
class Deploy class Deploy
OS_MAPPING = { OS_MAPPING = {
'PATCH_DEPLOY_ENVIRONMENT' => 'ubuntu-bionic', 'PATCH_DEPLOY_ENVIRONMENT' => 'ubuntu-focal',
'RELEASE_DEPLOY_ENVIRONMENT' => 'ubuntu-focal', 'RELEASE_DEPLOY_ENVIRONMENT' => 'ubuntu-focal',
}.freeze }.freeze
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
context 'with the auto-deploy tag' do context 'with the auto-deploy tag' do
before do before do
allow(Dir).to receive(:glob).with("pkg/**/*.{deb,rpm}").and_return(%w[pkg/ubuntu-bionic/gitlab-ee_16.7.0-ee.0_amd64.deb]) allow(Dir).to receive(:glob).with("pkg/**/*.{deb,rpm}").and_return(%w[pkg/ubuntu-focal/gitlab-ee_16.7.0-ee.0_amd64.deb])
allow(Build::Check).to receive(:is_auto_deploy?).and_return(true) allow(Build::Check).to receive(:is_auto_deploy?).and_return(true)
end end
...@@ -56,37 +56,6 @@ ...@@ -56,37 +56,6 @@
end end
end end
context 'when running on Ubuntu 18.04' do
before do
allow(Dir).to receive(:glob).with("pkg/**/*.{deb,rpm}").and_return(%w[pkg/ubuntu-bionic/gitlab-ee_16.7.0-ee.0_amd64.deb])
end
context 'with a release candidate (RC) tag' do
before do
allow(Build::Check).to receive(:is_rc_tag?).and_return(true)
end
it 'triggers deployment to specified environment' do
expect(DeployerHelper).to receive(:new).with('dummy-token', 'patch-environment', :master)
Rake::Task['gitlab_com:deployer'].invoke
end
end
context 'with a stable tag' do
before do
allow(Build::Check).to receive(:is_rc_tag?).and_return(false)
allow(Build::Check).to receive(:is_latest_stable_tag?).and_return(true)
end
it 'does not trigger deployment' do
expect(DeployerHelper).not_to receive(:new)
Rake::Task['gitlab_com:deployer'].invoke
end
end
end
context 'when running on Ubuntu 20.04' do context 'when running on Ubuntu 20.04' do
before do before do
allow(Dir).to receive(:glob).with("pkg/**/*.{deb,rpm}").and_return(%w[pkg/ubuntu-focal/gitlab-ee_16.7.0-ee.0_amd64.deb]) allow(Dir).to receive(:glob).with("pkg/**/*.{deb,rpm}").and_return(%w[pkg/ubuntu-focal/gitlab-ee_16.7.0-ee.0_amd64.deb])
...@@ -97,8 +66,8 @@ ...@@ -97,8 +66,8 @@
allow(Build::Check).to receive(:is_rc_tag?).and_return(true) allow(Build::Check).to receive(:is_rc_tag?).and_return(true)
end end
it 'does not trigger deployment' do it 'triggers deployment to the patch environment' do
expect(DeployerHelper).not_to receive(:new) expect(DeployerHelper).to receive(:new).with('dummy-token', 'patch-environment', :master)
Rake::Task['gitlab_com:deployer'].invoke Rake::Task['gitlab_com:deployer'].invoke
end end
...@@ -110,7 +79,7 @@ ...@@ -110,7 +79,7 @@
allow(Build::Check).to receive(:is_latest_stable_tag?).and_return(true) allow(Build::Check).to receive(:is_latest_stable_tag?).and_return(true)
end end
it 'triggers deployment to specified environment' do it 'triggers deployment to release environment' do
expect(DeployerHelper).to receive(:new).with('dummy-token', 'release-environment', :master) expect(DeployerHelper).to receive(:new).with('dummy-token', 'release-environment', :master)
Rake::Task['gitlab_com:deployer'].invoke Rake::Task['gitlab_com:deployer'].invoke
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment