Class: Opsk::Push

Inherits:
Thor::Group
  • Object
show all
Includes:
Thorable, Thor::Actions
Defined in:
lib/opskeleton/push.rb

Instance Method Summary collapse

Methods included from Thorable

#artifact, #artifact_path, #check_root, included, #machines, #meta, #name, #type_of

Instance Method Details

#pushObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/opskeleton/push.rb', line 18

def push
	Dir["modules/*"].reject{|o| not File.directory?(o)}.each do |d|
	  begin
 if File.exists?("#{d}/.git")
		git = Opsk::Git.new(d,self)
		git.add_writable(options)
		if !options['dry'] and git.local_ahead?
resp = yes?("Push #{d}? (y/n)") unless options['all']
if(options['all'] or resp)
  say "pushing #{d} .."
  git.push('writable') 
  git.pull
end
		end
 end
	  rescue => e
 say "Failed to push #{d} due to #{e}"
	  end
	end
end

#validateObject



13
14
15
# File 'lib/opskeleton/push.rb', line 13

def validate
	check_root
end