Skip to content

Commit

Permalink
Add the ability to install puppet-agent from a local dev build
Browse files Browse the repository at this point in the history
If the `DEV_BUILD_PATH` environment variable is set and refers to a
puppet-agent package, then it will be scp'ed to the remote system and
installed. This makes it possible to run beaker tests on a platform
without needing to generate repos or ship artifacts.

    export DEV_BUILD_PATH=/home/josh/work/puppet-agent/output/sles/12/puppet8/x86_64/puppet-agent-8.3.1.65.gc65ba7001-1.sles12.x86_64.rpm
    bundle exec rake ci:test:setup SHA=8.3.1 HOSTS=sles12-64a
    bundle exec beaker exec <test>

Where <test> is the file or directory of tests to execute against the remote system.

The SHA parameter is required, but unused.
  • Loading branch information
joshcooper committed Feb 2, 2024
1 parent 9536cbb commit 692a0e2
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions setup/aio/010_Install_Puppet_Agent.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
test_name 'Install Puppet Agent Packages' do
opts = {
nightly_builds_url: ENV.fetch('NIGHTLY_BUILDS_URL', nil),
dev_builds_url: ENV.fetch('DEV_BUILDS_URL', nil),
puppet_agent_version: ENV.fetch('SHA', nil),
puppet_collection: ENV.fetch('RELEASE_STREAM', nil),
}
agents.each do |agent|
path = ENV.fetch('DEV_BUILD_PATH', nil)
if path
raise ArgumentError, "The path #{path} does not exist" unless File.exist?(path)

basename = File.basename(path)
scp_to(agent, path, basename)

install_puppet_agent_on(hosts, opts)
# configure locations for ruby, puppet, config files, etc
add_aio_defaults_on(agent)
agent.install_package(basename)
else
opts = {
nightly_builds_url: ENV.fetch('NIGHTLY_BUILDS_URL', nil),
dev_builds_url: ENV.fetch('DEV_BUILDS_URL', nil),
puppet_agent_version: ENV.fetch('SHA', nil),
puppet_collection: ENV.fetch('RELEASE_STREAM', nil),
}

install_puppet_agent_on(hosts, opts)
end
end

# make sure install is sane, beaker has already added puppet and ruby
# to PATH in ~/.ssh/environment
agents.each do |agent|
agents.each do |agent| # rubocop:disable Style/CombinableLoops
on agent, puppet('--version')
ruby = ruby_command(agent)
on agent, "#{ruby} --version"
Expand Down

0 comments on commit 692a0e2

Please sign in to comment.