Class: UploadCookbook::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
DaptivChefCI::RakeTaskHelpers, Rake::DSL
Defined in:
lib/daptiv-chef-ci/upload_cookbook_task.rb

Overview

Example usage, uploads the current cookbook to the Chef server freezing it to the Canary environment.

UploadCookbook::RakeTask.new do |t|

t.environment = 'canary'
t.freeze = true

end

This class lets you define Rake tasks to upload cookbooks to Chef.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DaptivChefCI::RakeTaskHelpers

#execute, #exit_on_failure, #exit_on_failure=

Constructor Details

#initialize(name = 'upload_cookbook', desc = 'Upload cookbook task') {|_self| ... } ⇒ RakeTask

Returns a new instance of RakeTask.

Parameters:

  • name (String) (defaults to: 'upload_cookbook')

    The task name.

  • desc (String) (defaults to: 'Upload cookbook task')

    Description of the task.

Yields:

  • (_self)

Yield Parameters:



26
27
28
29
30
31
32
33
# File 'lib/daptiv-chef-ci/upload_cookbook_task.rb', line 26

def initialize(name = 'upload_cookbook', desc = 'Upload cookbook task')
  @logger = Log4r::Logger.new('daptiv_chef_ci::upload_cookbook_task')
  @shell = DaptivChefCI::Shell.new
  @name, @desc = name, desc
  @freeze = false
  yield self if block_given?
  define_task
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



21
22
23
# File 'lib/daptiv-chef-ci/upload_cookbook_task.rb', line 21

def environment
  @environment
end

#freezeObject

Returns the value of attribute freeze.



22
23
24
# File 'lib/daptiv-chef-ci/upload_cookbook_task.rb', line 22

def freeze
  @freeze
end