Class: Opsk::Update
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Opsk::Update
- Includes:
- Thorable, Thor::Actions
- Defined in:
- lib/opskeleton/update.rb
Instance Method Summary collapse
Methods included from Thorable
#artifact, #artifact_path, #check_root, included, #machines, #meta, #name, #type_of
Instance Method Details
#update ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/opskeleton/update.rb', line 6 def update Dir["./*"].reject{|o| not File.directory?(o)}.each do |d| resp = yes?("Update #{d}? (y/n)") unless ['all'] if File.exists?("#{d}/Puppetfile") and resp inside(d) do run("librarian-puppet update #{['module']}") end resp = yes?("Commit Puppetfile.lock#{d}? (y/n)") unless ['all'] if resp git = Opsk::Git.new(d,self) git.add("#{d}/Puppetfile.lock") git.commit("Opsk: updating #{['module']}") git.push end end end end |