I have a new Jenkins slave set up on which I call Unity CLI to build using my custom build method:
touch holo-build.log
if ! "$UNITY_APP" -projectPath "$WORKSPACE" \
-buildTarget WindowsStoreApps \
-executeMethod "$BUILD_METHOD" \
-quit -batchmode -logFile holo-build.log
then
echo "Unity did not report a successful build, refer to the holo-build.log to get details"
exit 1
fi
This actually already works on a different slave. On the new one however, Unity quits with success exit code (0) - causing Jenkins to proceed normally, but actually never created the solution. The whole Build folder remains empty except for the logfile, which does also not report anything special, only compilation notes with warnings but without errors and the last logged line is "Exiting batchmode successfully"
What could be the issue here?
Turns out Unity doesnt like to run outside a normal user. The jenkins service was set up to run under the system account which caused Unity to behave weirdly.
After changing the service to run under a normal user account, everything started working fine.
Note: there is also an interactive mode in the service properties when using the system account, which I thought might be enough, but failed as well.