Created
February 9, 2011 16:26
-
-
Save tyama/818752 to your computer and use it in GitHub Desktop.
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
def version = '1.3.7' //target version | |
def released = false | |
def sock | |
int interval = 120 | |
for(;;){ | |
if(!released){ | |
sock = new Socket('dist.springframework.org.s3.amazonaws.com',80) | |
sock.withStreams{input,output-> | |
output << "GET /release/GRAILS/grails-${version}.zip HTTP/1.1\r\n" | |
output << "Host: dist.springframework.org.s3.amazonaws.com\r\n" | |
output << "Connection: close:\r\n\r\n" | |
output.flush() | |
def line = input.newReader().readLine() | |
if(line && line == 'HTTP/1.1 200 OK'){ | |
released = true | |
interval = 5 | |
}else{ | |
print '.' | |
} | |
} | |
} | |
if(released){ | |
//mac only! | |
"say -v Agnes 'Grails ${version} Release'".execute() | |
} | |
Thread.sleep(1000*interval) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment