Skip to content

Commit

Permalink
(SIMP-3843) Fix bug in deps:record (#94)
Browse files Browse the repository at this point in the history
This commit fixes a bug in `deps:record` that prevented recording to a
custom Puppetfile._<method>_.  It also adds a new `:reference` parameter
to `deps:record` to specify a new Puppetfile for referencing which repos
to record.

SIMP-3834 #close
  • Loading branch information
op-ct authored and trevor-vaughan committed Oct 4, 2017
1 parent a929a53 commit 75a7d24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 5.1.0 / 2017-10-03
* Fixed bug in `deps:record` that prevented recording to Puppetfile.[:method]
* Added new `:reference` parameter to `deps:record` for identifying repos to
record

### 5.0.2 / 2017-10-03
* Determine the build/rpm_metadata/* files when the pkg:rpm
rake task is called, not when the rake object is constructed.
Expand Down
13 changes: 8 additions & 5 deletions lib/simp/rake/build/deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,16 @@ def define_tasks
Records the current dependencies into Puppetfile.stable.
Arguments:
* :source => The source Puppetfile to use (Default => 'tracking')
* :method => Save to Puppetfile.[method] (Default => 'stable')
* :reference => Use Puppetfile.[reference] to reference which repos
should be recorded (Default => 'tracking')
EOM
task :record, [:method] do |t,args|
args.with_defaults(:source => 'tracking')
r10k_helper = R10KHelper.new("Puppetfile.#{args[:source]}")
task :record, [:method,:reference] do |t,args|
args.with_defaults(:method => 'stable')
args.with_defaults(:reference => 'tracking')

File.open('Puppetfile.stable','w'){|f| f.puts r10k_helper.puppetfile }
r10k_helper = R10KHelper.new("Puppetfile.#{args[:reference]}")
File.open("Puppetfile.#{args[:method]}",'w'){|f| f.puts r10k_helper.puppetfile }
end

desc <<-EOM
Expand Down
2 changes: 1 addition & 1 deletion lib/simp/rake/helpers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ module Simp; end
module Simp::Rake; end

class Simp::Rake::Helpers
VERSION = '5.0.2'
VERSION = '5.1.0'
end

0 comments on commit 75a7d24

Please sign in to comment.