Skip to content

Commit aa12ae6

Browse files
twk3balasankarc
andcommitted
Merge branch 'remove-old-ami-build-logic' into 'master'
Remove old code used for AMI builds See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7049 Merged-by: DJ Mountney <[email protected]> Approved-by: Jason Plum <[email protected]> Approved-by: DJ Mountney <[email protected]> Co-authored-by: Balasankar "Balu" C <[email protected]>
2 parents 9ad9cb9 + d282fbb commit aa12ae6

16 files changed

+1
-1012
lines changed

lib/gitlab/aws_helper.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@ def initialize(version, type)
1414
@type = type || 'ce'
1515
end
1616

17-
def create_ami_old
18-
release_type = Gitlab::Util.get_env('AWS_RELEASE_TYPE')
19-
architecture = Gitlab::Util.get_env('AWS_ARCHITECTURE')
20-
args = {}
21-
22-
if (@type == 'ee') && release_type
23-
@type = "ee-#{release_type}"
24-
@license_file = "AWS_#{release_type}_LICENSE_FILE".upcase
25-
end
26-
27-
if architecture
28-
args = { arch: architecture }
29-
@type = "#{@type}-#{architecture}"
30-
end
31-
32-
@download_url = Build::Info.ami_deb_package_download_url(**args)
33-
34-
system(*%W[support/packer_old/packer_ami.sh #{@version} #{@type} #{@download_url} #{@license_file}])
35-
end
36-
3717
def create_ami
3818
release_type = Gitlab::Util.get_env('AWS_RELEASE_TYPE')
3919
architecture = Gitlab::Util.get_env('AWS_ARCHITECTURE')

lib/gitlab/build/info.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,6 @@ def log_level
156156
end
157157
end
158158

159-
# Fetch the package used in AWS AMIs from an S3 bucket
160-
def ami_deb_package_download_url(arch: 'amd64')
161-
folder = 'ubuntu-focal'
162-
folder = "#{folder}_aarch64" if arch == 'arm64'
163-
164-
package_filename_url_safe = Info.release_version.gsub("+", "%2B")
165-
"https://#{Info.release_bucket}.#{Info.release_bucket_s3_endpoint}/#{folder}/#{Info.package}_#{package_filename_url_safe}_#{arch}.deb"
166-
end
167-
168159
def release_file_contents
169160
repo = Gitlab::Util.get_env('PACKAGECLOUD_REPO') # Target repository
170161

lib/gitlab/tasks/aws.rake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ namespace :aws do
1212
next if Build::Check.is_auto_deploy? || Build::Check.is_rc_tag?
1313

1414
Omnibus.load_configuration('omnibus.rb')
15-
if Gitlab::Util.get_env('AMI_USE_OLD_BUILD_PROCESS') == "true"
16-
AWSHelper.new(Omnibus::BuildVersion.semver, Build::Info.edition).create_ami_old
17-
else
18-
AWSHelper.new(Omnibus::BuildVersion.semver, Build::Info.edition).create_ami
19-
end
15+
AWSHelper.new(Omnibus::BuildVersion.semver, Build::Info.edition).create_ami
2016
end
2117
end
2218

spec/lib/gitlab/tasks/aws_spec.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,6 @@ def deregister_image(parameters)
4444
stub_env_var('CI_JOB_TOKEN', 'CI-NO-JOB-TOKEN')
4545
end
4646

47-
context 'when using `AMI_USE_OLD_BUILD_PROCESS` environment variable' do
48-
before do
49-
stub_env_var('AMI_USE_OLD_BUILD_PROCESS', 'true')
50-
allow(Build::Check).to receive(:on_tag?).and_return(true)
51-
allow(Build::Check).to receive(:is_auto_deploy?).and_return(false)
52-
allow(Build::Check).to receive(:is_rc_tag?).and_return(false)
53-
allow(Build::Info).to receive(:ami_deb_package_download_url).and_return('http://example.com')
54-
end
55-
56-
it 'should call the old script' do
57-
allow(Build::Info).to receive(:edition).and_return('ce')
58-
allow(Omnibus::BuildVersion).to receive(:semver).and_return('9.3.0')
59-
60-
expect_any_instance_of(Kernel).to receive(:system).with(*["support/packer_old/packer_ami.sh", "9.3.0", "ce", "http://example.com", ""])
61-
62-
Rake::Task['aws:ami:create'].invoke
63-
end
64-
end
65-
6647
describe 'on a regular tag' do
6748
before do
6849
allow(Build::Check).to receive(:on_tag?).and_return(true)

support/packer_old/ami-startup-script.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

support/packer_old/ce-arm64.pkr.hcl

Lines changed: 0 additions & 134 deletions
This file was deleted.

support/packer_old/ce.pkr.hcl

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)