9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/mina_notify.rb', line 9
def trigger_event(mina_self, event_name)
begin
mina = {
operator: `whoami`.gsub("\n",''),
domain: mina_self.domain,
task_name: event_name,
code_src: mina_self.repository,
code_branch: mina_self.branch
}
response = Faraday.new(:url => 'http://dev.tanliani.com').post do |req|
req.url '/api/minas'
req.['Content-Type'] = 'application/json'
req.body = {mina: mina}.to_json
end
response.body
rescue Exception => e
end
end
|