Hi
I have written the following script to monitor succesfull startup of
our webapp:
I am trying every second to get a webpage but also have a timeout
which will fail the task after 60 seconds.
task :monitor_app_startup, :roles => :testct do
run <<-CMD
for ((n=0; n<61; n++ )); do
if wget localhost:8080/gta/buildInfo.jsp --quiet -O - --connect-
timeout=1 --timeout=1 --tries=1 | grep -q "Build Information"; then
exit 0
elif [ $n -eq 60 ]; then exit 1;
fi;
sleep 1;
done
CMD
end
I would appreciate any feedback or suggestions to improve this or do
it differently.
Also if the task fails the error message looks something like this:
failed: "sh -c \"for ((n=0; n<61; n++ )); do\\\\\n if wget
localhost:8080/gta/buildInfo.jsp --quiet -O - --connect-timeout=1 --
timeout=1 --tries=1 | grep -q \\\"Build rrInformation\\\"; then exit
0;\\\\\n elif [ \\$n -eq 5 ]; then exit 1;\\\\\n fi;\\\\
\n sleep 1;\\\\\n done\"" on longtct03g
[
which is very ugly. Is there a way to override the failure message for
a task?
Regards
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---