I have the following post-build Jenkins script shell:
ssh user@my _server <<EOF service my_service stop service my_service start tail -f /opt/services/my_service/logs/current exit EOF
This script reloads my_service on the remote host (my_server).
My problem: the service command my_service start just makes a RUNIT request to start my_service, i.e. the my_service start service is returned immediately after execution.
But the my_service start service starts the SpringBoot java web application, which writes all the log information to ... / logs / the current log file. To catch this log information, I added the command tail -f / opt / services / my_service / logs / current , but in this case the Jenkins build never ends)), for example tail -f never stops.
Is there a way to execute my post-build script (which runs only my web application on a remote server) and capture the file ... / logs / current log for 2 minutes or until this log has the line "MyApplication web application started applications. "
I want to view the contents of ... / logs / of the current log file directly in the Jenkins console output and kill tail -f after 2 minutes
source share