I have a long taking batch process in Jenkins (Unity3D to be exact) that doesn't provide any output to the console.
It only writes a logfile lets say unityLog.txt and does not produce any output to the console itself.
I need to display the output while it gets appended to the logfile in the console so it gets visible to the user via the Jenkins web interface.
So what I am currently doing is e.g. (more on the Unity Command line argments)
E:\Unity\2019.3.3f1\Editor\Unity.exe -quit -batchmode -projectPath E:\Projects\Example -executeMethod JENKINS.AutoBuilder.PerformBuild -logFile unityLog.txt -buildFolder E:\Projects\Example\Build
type unityLog.txt
The command actually runs in the project folder so this works but only displays the content of the file after unity finishes.
I have already read a lot questions similar to Displaying Windows command prompt output and redirecting it to a file which works great but they always assume the command itself produces any direct console output.
As said this is not the case here.
So what I would need is actually a form doing in batch what in bash I probably would do like (This is also just an example, unfortunately not a bash expert either ;) )
function MyLongTakingProcess()
{
pid=$!
E:\Unity\2019.3.3f1\Editor\Unity.exe -quit -batchmode -projectPath E:\Projects\Example -executeMethod JENKINS.AutoBuilder.PerformBuild -logFile unityLog.txt -buildFolder E:\Projects\Example\Build
kill $pid
}
touch unityLog.txt
tail -f unityLog.txt & MyLongTakingProcess
to permanently display added lines but cancel this as soon as the command has finished.
Any idea how this could be achieved?