Skip to content

Commit

Permalink
Merge pull request #1396 from justinstoller/mergeup3x
Browse files Browse the repository at this point in the history
(maint) Merge up 3.x into main
  • Loading branch information
donoghuc authored Aug 5, 2024
2 parents 8dd238f + 17d48ea commit c8ec669
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 26 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 3.x
paths:
- 'lib/r10k/version.rb'

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Unreleased
- (RK-383) Remove deprecated `basedir` method from Puppetfile DSL. Users should use `environment_name` instead. [#1254](https://github.com/puppetlabs/r10k/pull/1254)
- (RK-386) Remove deprecated `bare` environment type. [#1235](https://github.com/puppetlabs/r10k/issues/1235)

3.16.2
------

- r10k::module::git: expose remote as getter [#1379](https://github.com/puppetlabs/r10k/pull/1379)

3.16.1
------
Expand Down
5 changes: 2 additions & 3 deletions integration/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ def location_for(place, fake_version = nil)
end
end

gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 4.5')
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 4.40')
gem 'beaker-pe', '~> 3.0'
gem 'beaker-answers'
gem 'beaker-hostgenerator', *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || '~> 1.1')
gem 'beaker-abs', *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.4')
gem 'rototiller', '= 0.1.0'
gem 'rototiller', '= 1.0'
gem 'beaker-qa-i18n'
81 changes: 58 additions & 23 deletions integration/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ end
desc 'The acceptance tests for r10k, run in the beaker framework'
rototiller_task :beaker => [:beaker_hostgenerator] do |t|

common_setup = <<-EOS
pre-suite/00_pe_install.rb,
component/pre-suite/05_install_dev_r10k.rb,
pre-suite/10_git_config.rb,
pre-suite/20_pe_r10k.rb,
EOS
common_setup.gsub!("\n", '')

flags = [
{:name => '--hosts', :default => 'configs/generated', :override_env => 'BEAKER_HOST'},
{:name => '--keyfile', :default => "#{ENV['HOME']}/.ssh/id_rsa-acceptance", :override_env => 'BEAKER_KEYFILE'},
{:name => '--load-path', :default => 'lib'},
{:name => '--pre-suite', :default => @acceptance_pre_suite || common_setup, :override_env => 'BEAKER_PRE_SUITE'},
{:name => '--tests', :default => 'tests', :override_env => 'BEAKER_TESTS'},
{:name => '--preserve-hosts', :default => 'onfail', :override_env => 'BEAKER_PRESERVE_HOSTS'},
]
t.add_flag(*flags)

t.add_env do |env|
env.name = 'PE_FAMILY'
env.message = 'The puppet enterprise major branch to install from'
Expand All @@ -54,7 +36,62 @@ EOS
env.message = 'The git provider that r10k should use on a SUT'
end

t.add_command({:name => 'beaker --debug', :override_env => 'BEAKER_EXECUTABLE'})
t.add_command do |cmd|
cmd.name = 'beaker --debug'

common_setup = <<-EOS
pre-suite/00_pe_install.rb,
component/pre-suite/05_install_dev_r10k.rb,
pre-suite/10_git_config.rb,
pre-suite/20_pe_r10k.rb,
EOS
common_setup.gsub!("\n", '')

cmd.add_option do |opt|
opt.name = '--hosts'
opt.add_argument do |arg|
arg.name = 'configs/generated'
arg.add_env({name: 'BEAKER_HOST'})
end
end

cmd.add_option do |opt|
opt.name = '--keyfile'
opt.add_argument do |arg|
arg.name = "#{ENV['HOME']}/.ssh/id_rsa-acceptance"
arg.add_env({name: 'BEAKER_KEYFILE'})
end
end

cmd.add_option do |opt|
opt.name = '--pre-suite'
opt.add_argument do |arg|
arg.name = @acceptance_pre_suite || common_setup
arg.add_env({name: 'BEAKER_PRE_SUITE'})
end
end

cmd.add_option do |opt|
opt.name = '--tests'
opt.add_argument do |arg|
arg.name = 'tests'
arg.add_env({name: 'BEAKER_TESTS'})
end
end

cmd.add_option do |opt|
opt.name = '--preserve-hosts'
opt.add_argument do |arg|
arg.name = 'onfail'
arg.add_env({name: 'BEAKER_PRESERVE_HOSTS'})
end
end

cmd.add_option do |opt|
opt.name = '--load-path'
opt.add_argument({name: 'lib'})
end
end
end

desc 'Generate a host configuration used by Beaker'
Expand All @@ -64,12 +101,10 @@ rototiller_task :beaker_hostgenerator do |t|
t.add_command do |c|
c.name = 'beaker-hostgenerator'
c.argument = '> configs/generated'
c.add_option(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET')
c.add_option(:name => '--global-config', :default => '{forge_host=forgeapi.puppet.com}', :override_env => 'BHG_GLOBAL_CONFIG')
end

# This is a hack :(
t.add_flag(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET')

t.add_flag(:name => '--global-config', :default => '{forge_host=forgeapi.puppet.com}', :override_env => 'BHG_GLOBAL_CONFIG')
end
end

Expand Down
1 change: 1 addition & 0 deletions integration/pre-suite/10_git_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
on(master, puppet('apply'), :stdin => git_manifest, :acceptable_exit_codes => [0,2]) do |result|
assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
end
on(master, 'git config --system --add safe.directory "*"')

step 'Create "production" Environment on Git'
init_r10k_source_from_prod(master, git_repo_path, git_repo_name, git_environments_path, 'production')
Expand Down

0 comments on commit c8ec669

Please sign in to comment.