function pre deploy
pre_deploy performs steps needed before executing the test_deploy function.
This internal function checks to see if the software has been built. If
it can't find the build directory, or if a previous build failed (detected
by the presend of a "build_failed" file in the build directory, then
pre_deploy tries to build the software again.
pre_deploy uses the following environment variables:
returns non-zero for error.
Located in scripts/functions.sh