Class: Builderator::Tasks::Berks
- Inherits:
-
Thor
- Object
- Thor
- Builderator::Tasks::Berks
- Includes:
- Thor::Actions
- Defined in:
- lib/builderator/tasks/berks.rb
Instance Method Summary collapse
- #clean(path = Util::Cookbook::DEFAULT_VENDOR) ⇒ Object
- #local(path = Util::Cookbook::DEFAULT_VENDOR.to_s) ⇒ Object
- #uncache ⇒ Object
- #upload(path = Util::Cookbook::DEFAULT_VENDOR.to_s) ⇒ Object
- #vendor(path = Util::Cookbook::DEFAULT_VENDOR.to_s) ⇒ Object
Instance Method Details
#clean(path = Util::Cookbook::DEFAULT_VENDOR) ⇒ Object
63 64 65 |
# File 'lib/builderator/tasks/berks.rb', line 63 def clean(path = Util::Cookbook::DEFAULT_VENDOR) remove_dir path end |
#local(path = Util::Cookbook::DEFAULT_VENDOR.to_s) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/builderator/tasks/berks.rb', line 17 def local(path = Util::Cookbook::DEFAULT_VENDOR.to_s) Util::Cookbook.path(['cookbook']) command = 'BERKS_INSTALL_FROM=source' command << " berks vendor #{ path }" command << " -c #{ ['config'] }" if .include?('config') command << " -b #{ Util::Cookbook.berksfile }" remove_file File.('Berksfile.lock', Util::Cookbook.path) invoke Tasks::Cookbook, 'metadata', [], run command end |
#uncache ⇒ Object
58 59 60 |
# File 'lib/builderator/tasks/berks.rb', line 58 def uncache remove_dir File.join(ENV['HOME'], '.berkshelf/cookbooks') end |
#upload(path = Util::Cookbook::DEFAULT_VENDOR.to_s) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/builderator/tasks/berks.rb', line 45 def upload(path = Util::Cookbook::DEFAULT_VENDOR.to_s) command = 'BERKS_INSTALL_FROM=source' command << " berks upload" command << " -c #{ ['config'] }" if .include?('config') command << " -b #{ Util::Cookbook.berksfile }" invoke Tasks::Berks, :local, [path], return say_status :dryrun, command if ['dry-run'] run command end |
#vendor(path = Util::Cookbook::DEFAULT_VENDOR.to_s) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/builderator/tasks/berks.rb', line 31 def vendor(path = Util::Cookbook::DEFAULT_VENDOR.to_s) Util::Cookbook.path(['cookbook']) command = 'BERKS_INSTALL_FROM=release' command << " berks vendor #{ path }" command << " -c #{ ['config'] }" if .include?('config') command << " -b #{ Util::Cookbook.berksfile }" remove_file File.('Berksfile.lock', Util::Cookbook.path) run command end |