Class: Opsk::Update

Inherits:
Thor::Group
  • Object
show all
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

#updateObject



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 options['all']
	  if File.exists?("#{d}/Puppetfile") and resp
 inside(d) do
		run("librarian-puppet update #{options['module']}")
 end
 resp = yes?("Commit Puppetfile.lock#{d}? (y/n)") unless options['all']
 if resp
		git = Opsk::Git.new(d,self)
		git.add("#{d}/Puppetfile.lock")
		git.commit("Opsk: updating #{options['module']}")
		git.push
 end
	  end
	end
end