Class: VersionCookbook::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- VersionCookbook::RakeTask
- Includes:
- DaptivChefCI::RakeTaskHelpers, Rake::DSL
- Defined in:
- lib/daptiv-chef-ci/version_cookbook_task.rb
Overview
Example usage, versions a cookbook to 1.0.x for usage in CI
VersionCookbook::RakeTask.new ‘version_cookbook’ do |t|
t.bump = false
t.version = "1.0.#{ENV['BUILD_NUMBER']}"
t.version_file = 'version.txt'
end
This class lets you define Rake tasks to manage a cookbook version.txt file
Instance Attribute Summary collapse
-
#bump ⇒ Object
Returns the value of attribute bump.
-
#version ⇒ Object
Returns the value of attribute version.
-
#version_file ⇒ Object
Returns the value of attribute version_file.
Instance Method Summary collapse
-
#initialize(name = 'version_cookbook', desc = 'Version cookbook task') {|_self| ... } ⇒ RakeTask
constructor
A new instance of RakeTask.
Methods included from DaptivChefCI::RakeTaskHelpers
#execute, #exit_on_failure, #exit_on_failure=
Constructor Details
#initialize(name = 'version_cookbook', desc = 'Version cookbook task') {|_self| ... } ⇒ RakeTask
Returns a new instance of RakeTask.
28 29 30 31 32 33 34 35 |
# File 'lib/daptiv-chef-ci/version_cookbook_task.rb', line 28 def initialize(name = 'version_cookbook', desc = 'Version cookbook task') @logger = Log4r::Logger.new('daptiv_chef_ci::version_cookbook_task') @name, @desc = name, desc @version_file = File.join(Dir.pwd, 'version.txt') @bump = true yield self if block_given? define_task end |
Instance Attribute Details
#bump ⇒ Object
Returns the value of attribute bump.
22 23 24 |
# File 'lib/daptiv-chef-ci/version_cookbook_task.rb', line 22 def bump @bump end |
#version ⇒ Object
Returns the value of attribute version.
23 24 25 |
# File 'lib/daptiv-chef-ci/version_cookbook_task.rb', line 23 def version @version end |
#version_file ⇒ Object
Returns the value of attribute version_file.
24 25 26 |
# File 'lib/daptiv-chef-ci/version_cookbook_task.rb', line 24 def version_file @version_file end |