Last active
December 15, 2015 10:19
-
-
Save maciej/5244513 to your computer and use it in GitHub Desktop.
Tells me when my app is deployed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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