Skip to content

Commit

Permalink
(breaking) - Remove build rake tasks
Browse files Browse the repository at this point in the history
This commit removes the build rake tasks from puppetlabs_spec_helper, as
it does not make sense to have these exist in a gem which sole purpose
is to help unit testing.

As such, we will add the build rake task to puppet-modulebuilder.
  • Loading branch information
jordanbreen28 committed Sep 13, 2024
1 parent 6e600d1 commit 9b9bb25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
24 changes: 0 additions & 24 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,6 @@
end
end

desc 'Build puppet module package'
task :build do
Rake::Task['build:pdk'].invoke
end

namespace :build do
desc 'Build Puppet module with PDK'
task :pdk do
require 'pdk/util'
require 'pdk/module/build'

path = PDK::Module::Build.invoke(force: true, 'target-dir': File.join(Dir.pwd, 'pkg'))
puts "Module built: #{path}"
rescue LoadError
_ = `pdk --version`
unless $CHILD_STATUS.success?
warn 'Unable to build module. Please install PDK or add the `pdk` gem to your Gemfile.'
abort
end

system('pdk build --force')
end
end

desc 'Clean a built module package'
task :clean do
FileUtils.rm_rf('pkg/')
Expand Down
1 change: 1 addition & 0 deletions puppetlabs_spec_helper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'mocha', '>= 1.0', '< 3'
spec.add_runtime_dependency 'pathspec', '>= 0.2', '< 3'
spec.add_runtime_dependency 'puppet-lint', '~> 4.0'
spec.add_runtime_dependency 'puppet-modulebuilder', '~> 1.0'
spec.add_runtime_dependency 'puppet-syntax', '~> 4.1', '>= 4.1.1'
spec.add_runtime_dependency 'rspec-github', '~> 2.0'
spec.add_runtime_dependency 'rspec-puppet', '~> 5.0'
Expand Down

0 comments on commit 9b9bb25

Please sign in to comment.