Class: PuppetModule::Pkg::Tasks::RakeTasks

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/puppet_module/pkg/tasks/rake_tasks.rb

Instance Method Summary collapse

Constructor Details

#initialize(mod_info, custom_opts) ⇒ RakeTasks

Returns a new instance of RakeTasks.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/puppet_module/pkg/tasks/rake_tasks.rb', line 14

def initialize(mod_info, custom_opts)
  sys = System.new
  options = OpenStruct.new({
    :install_dir      => 'build',
    :pkg_dir          => 'pkg',
    :dep_install_path => 'tmp/deps_inst',
    :dep_build_path   => 'tmp/deps_build',
    :recursive        => false
  }.merge(custom_opts))
  mod_finder = (options.recursive ? ModuleFinder : ModuleFinder::Disabled).new sys

  desc "Install the module in a local temp dir"
  task :install => :clean do
    Install.new(sys).invoke(mod_info, options)
  end

  desc "Clean build artifacts"
  task :clean do
    Clean.new(sys).invoke(mod_info, options)
  end

  desc "Wraps the module into a Debian package"
  task :deb => :install do
    Deb.new(sys, mod_finder).invoke(mod_info, options)
  end

  desc "Wraps the module into a RPM package"
  task :rpm => :install do
    RPM.new(sys, mod_finder).invoke(mod_info, options)
  end
end