Skip to content

Instantly share code, notes, and snippets.

@maciej
Last active December 15, 2015 10:19
Show Gist options
  • Save maciej/5244513 to your computer and use it in GitHub Desktop.
Save maciej/5244513 to your computer and use it in GitHub Desktop.
Tells me when my app is deployed.
#!/usr/bin/env ruby
require 'rest-client'
sleep 4
loop do
sleep 1
response = begin
RestClient.get("http://localhost:8080/app/diagnostics.json")
rescue => e
e.response
end
# Happens in case of connection timeout
if response.nil?
next
end
case response.code
when 200
`say \"Deployed.\"`
break
when 500
`say \"Deployment error.\"`
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment