| # Run an obmc test robot program in a docker environment. |
| # This program is to be run from a Jenkins job such as 'Run-Robot-Program'. |
| # This program expects the Jenkins job to provide several parameter values |
| # as environment variables. This includes but is not limited to the |
| # Source other bash files containing required functions. |
| source_files="jenkins_funcs.sh" |
| pathlist=$(/usr/bin/which $source_files) || exit 1 |
| for filepath in $pathlist ; do source $filepath || exit 1 ; done |
| # Fail if an unset variable is accessed. |
| WORKSPACE="${WORKSPACE:-${HOME}}" |
| git_dir_path="${git_dir_path:-${WORKSPACE}}" |
| # Follow the convention of ensuring that dir paths end with slash. |
| WORKSPACE="${WORKSPACE%/}/" |
| git_dir_path="${git_dir_path%/}/" |
| # Delete leftover output from prior runs. |
| rm -f ${WORKSPACE}*.html ${WORKSPACE}*.xml || return 1 |
| process_git "${git_dir_path}" "${post_clone_command-}" || return 1 |
| process_docker "${git_dir_path}" || return 1 |
| if [ -z "${robot_file_path-}" ] ; then |
| echo "robot_file_path is blank so no there is no need to continue." |
| run_docker_robot "${robot_file_path}" || return 1 |