Vagrant: Log file only copied when build succeeds
When a build using Vagrant succeeds, three files are copied from the VM:
If the build fails for whatever reason, the log file is not copied from the VM.
Build system: set up infrastructure to retrieve log file from the VM even on build failure (refs: #7749)
Currently, when a build failed locally, the only way to investigate the failure
was to use one's terminal scrolling & searching features, because we did not
retrieve the build log. It would be nice to give developers the option to
analyze the log using whatever other tools they prefer.
This commit is not sufficient to fix this problem: we retrieve artifacts from
/home/vagrant/amnesia, but build-tails moves them there only once the build has
succeeded. To fix the problem we need to drop the "move artifacts from the
build directory to /home/vagrant/amesia" build step and retrieve the artifacts
directly from the build directory; as explained on
https://redmine.tails.boum.org/code/issues/11171#note-6, this requires moving
the build directory cleanup operations outside of build-tails.
Still, even as-is, I find this commit useful as it refactors things a bit,
makes the build task smaller, and gets us closer to the goal.