Skip to content

Commit

Permalink
AgileBench service - v1 (with static IP)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszMichalski committed Mar 16, 2012
1 parent 8529ab2 commit d242362
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions services/agile_bench.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class Service::AgileBench < Service
string :token, :project_id

def receive_push
token, project_id =
data['token'].to_s.strip, data['project_id'].to_s.strip

raise_config_error "Invalid Token" if !token.present?
raise_config_error "Invalid Project ID" if !project_id.present?

response = {:token => token,
:project_id => project_id}

if payload["commits"]
response.merge!({ :commit => {
:message => payload['commits'].last["message"]
},
:github_user => {
:username => payload['commits'].last["committer"]["username"],
:email => payload['commits'].last["committer"]["email"]
}
})
end

http_post "http://93.181.168.171:9393/",
{:data => response.to_json}
end
end

0 comments on commit d242362

Please sign in to comment.