Skip to content

Instantly share code, notes, and snippets.

@tyama
Created February 9, 2011 16:26
Show Gist options
  • Save tyama/818752 to your computer and use it in GitHub Desktop.
Save tyama/818752 to your computer and use it in GitHub Desktop.
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