In my job have a Portal (Liferay but customized) with our own portlets, they works perfectly but the deployment of all them take too long(30-40 minutes), one of my goals is to know when every single portlet is up, tipically the user have to go the portlet view and check if the portlet is available, but this is considered unpractically.
I'm making a bash script, basically it executes http requests through cURL to the views of every portlet, but it is not working in the way I wanted, because even when the portlet is not deployed, the resource is marked as available, do you have a suggestion or something for this issue?, I'll attach a piece of my code below
#!/bin/bash
portlet='web/view/your_first_portlet web/view/your_second_portlet';
for i in $portlet;do
if [ -z "$(curl -v --silent http://portal/$i 2>&1 | grep "The requested resource was not found.")" ]
then
echo "$i is ready"
else
echo "$i is NOT ready"
fi
done
When the cURL command runs , it search for an ocurrence of the string "The requested resource was not found." because I discovered that when the resource is not available, in catalina ouput(tomcat) throws a null, but with http request shows the message inside the code returned, but even with it the portlet is not deployed and the script says otherwise.