Class: Rake

Inherits:
QuartzPlugin show all
Defined in:
lib/plugins/rake.rb

Constant Summary collapse

@@version_major =
0
@@version_minor =
0
@@version_revision =
1

Instance Method Summary collapse

Methods inherited from QuartzPlugin

#get_version, #initialize, #payload, #run_result, #run_shell

Constructor Details

This class inherits a constructor from QuartzPlugin

Instance Method Details

#infoObject



9
10
11
# File 'lib/plugins/rake.rb', line 9

def info
	{ :uid => "62e3583abfc24f209916c4ff97661fa0", :name => "Rake", :version => get_version }
end

#run(message) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/plugins/rake.rb', line 13

def run(message)
	@log.debug "Running with #{message}"
	payload = payload(message)
	task = payload['task']
	location = payload['location']
	params = payload['params']
	@log.info "Rake #{task} in #{location} with params:#{params}"

	begin
		result = run_shell("bundle exec rake #{task} #{params}")
		run_result(result[:ok], result[:message])
	rescue => ex
		run_result(false, "Failed to run rake due to #{ex}")
	end
end