Skip to content

Commit 4334402

Browse files
Robert Marshallbalasankarc
andcommitted
Merge branch '8490-fix-rat-fips-package-url' into 'master'
Fix RAT_FIPS_PACKAGE_URL not having fips suffix in path Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8490 See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7552 Merged-by: Robert Marshall <[email protected]> Approved-by: Robert Marshall <[email protected]> Co-authored-by: Balasankar 'Balu' C <[email protected]>
2 parents 8264314 + 7eeb584 commit 4334402

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

lib/gitlab/build/info/ci.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,24 @@ def package_download_url(job_name: "Ubuntu-22.04", arch: 'amd64', fips: Build::C
5656
# In EL world, amd64 is called x86_64
5757
arch = 'x86_64' if arch == 'amd64'
5858
folder = 'el-8'
59-
package_file_name = "#{Info::Package.name}-#{Info::Package.release_version.gsub('+', '%2B')}.el8.#{arch}.rpm"
59+
package_file_name = "#{Info::Package.name(fips: fips)}-#{Info::Package.release_version(fips: fips).gsub('+', '%2B')}.el8.#{arch}.rpm"
6060
when /Ubuntu-20.04/
6161
folder = 'ubuntu-focal'
62-
package_file_name = "#{Info::Package.name}_#{Info::Package.release_version.gsub('+', '%2B')}_#{arch}.deb"
62+
package_file_name = "#{Info::Package.name(fips: fips)}_#{Info::Package.release_version(fips: fips).gsub('+', '%2B')}_#{arch}.deb"
6363
when /Ubuntu-22.04/
6464
folder = 'ubuntu-jammy'
65-
package_file_name = "#{Info::Package.name}_#{Info::Package.release_version.gsub('+', '%2B')}_#{arch}.deb"
65+
package_file_name = "#{Info::Package.name(fips: fips)}_#{Info::Package.release_version(fips: fips).gsub('+', '%2B')}_#{arch}.deb"
6666
end
6767

6868
if arch == 'arm64'
6969
job_name = "#{job_name}-arm64"
7070
folder = "#{folder}_aarch64"
7171
end
7272

73-
job_name = "#{job_name}-fips" if fips
73+
if fips
74+
job_name = "#{job_name}-fips"
75+
folder = "#{folder}_fips"
76+
end
7477

7578
job_name = "#{job_name}-branch" unless Build::Info::CI.tag_name
7679

lib/gitlab/build/info/package.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Package
1010
PACKAGE_GLOB = "pkg/**/*.{deb,rpm}".freeze
1111

1212
class << self
13-
def name
14-
return "gitlab-fips" if Check.use_system_ssl?
13+
def name(fips: Check.use_system_ssl?)
14+
return "gitlab-fips" if fips
1515
return "gitlab-ee" if Check.is_ee?
1616

1717
"gitlab-ce"
@@ -32,7 +32,7 @@ def edition
3232
# package version will remain the same but contents of the package will be
3333
# different.
3434
# To resolve this, we append a PIPELINE_ID to change the name of the package
35-
def semver_version
35+
def semver_version(fips: Build::Check.use_system_ssl?)
3636
if Build::Check.on_tag?
3737
# timestamp is disabled in omnibus configuration
3838
Omnibus.load_configuration('omnibus.rb')
@@ -42,13 +42,13 @@ def semver_version
4242
latest_version = latest_git_tag && !latest_git_tag.empty? ? latest_git_tag[0, latest_git_tag.match("[+]").begin(0)] : '0.0.1'
4343
commit_sha = Build::Info::Git.commit_sha
4444
ver_tag = "#{latest_version}+" + (Build::Check.is_nightly? ? "rnightly" : "rfbranch")
45-
ver_tag += ".fips" if Build::Check.use_system_ssl?
45+
ver_tag += ".fips" if fips
4646
[ver_tag, Gitlab::Util.get_env('CI_PIPELINE_ID'), commit_sha].compact.join('.')
4747
end
4848
end
4949

50-
def release_version
51-
semver = Info::Package.semver_version
50+
def release_version(fips: Build::Check.use_system_ssl?)
51+
semver = Info::Package.semver_version(fips: fips)
5252
"#{semver}-#{Gitlab::BuildIteration.new.build_iteration}"
5353
end
5454

0 commit comments

Comments
 (0)