Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PE-27608) Master branch PEZ logic #176

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lib/beaker-hostgenerator/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module BeakerHostGenerator
# `include BeakerHostGenerator::Data` and then `<function>()`.
module Data
module_function

MASTER_PE_VERSION=2019.4
PE_TARBALL_SERVER="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local"

def pe_version
Expand Down Expand Up @@ -41,7 +41,16 @@ def pe_dir(version)
''
end

pe_branch = Gem::Version.new($1) < Gem::Version.new('2019.4') || version =~ /#{base_regex}-rc\d+\Z/ ? $1 : 'master'
if(Gem::Version.new($1) < Gem::Version.new("#{MASTER_PE_VERSION}") || version =~ /#{base_regex}-rc\d+\Z/)
pe_branch = $1
else
#Is this a Master PEZ build?
if(version =~ /.*(PEZ|pez)_.*/)
pe_branch = "master/feature"
else
pe_branch = 'master'
end
end

return sprintf(source, ("#{pe_branch}" || ''))
end
Expand Down
2 changes: 1 addition & 1 deletion spec/beaker-hostgenerator/generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module BeakerHostGenerator
end

it "returns master/feature/ci-ready for a PEZ version" do
expect(BeakerHostGenerator::Data.pe_dir(pez_version)).to match(%r{master/feature/ci-ready})
expect(BeakerHostGenerator::Data.pe_dir(pez_version)).to match('master/feature')
end
end
end
Expand Down