Skip to content

Commit

Permalink
Merge pull request #176 from cthorn42/maint/master/PE-27608_fix_up_ma…
Browse files Browse the repository at this point in the history
…ster_branch_pez_dir

(PE-27608) Master branch PEZ logic
  • Loading branch information
barriserloth authored Jan 9, 2020
2 parents 135951f + 63ce3f7 commit 36e14f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
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

0 comments on commit 36e14f7

Please sign in to comment.