| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | #!/bin/bashset -eecho "running tfb-shutdown script"./tfb-shutdown.shecho "removing old tfb directory if necessary"if [ -d "$TFB_REPOPARENT/$TFB_REPONAME" ]; then  sudo rm -rf $TFB_REPOPARENT/$TFB_REPONAMEfiecho "cloning tfb repository"git clone \  -b $TFB_REPOBRANCH \  $TFB_REPOURI \  $TFB_REPOPARENT/$TFB_REPONAME \  --depth 1echo "moving to tfb directory"cd $TFB_REPOPARENT/$TFB_REPONAMEif [ -z "$TFB_RUN_ORDER" ]; then  export TFB_RUN_ORDER="reverse"else  unset TFB_RUN_ORDERfiecho "building tfb docker image"docker build -t techempower/tfb \  --build-arg USER_ID=$(id -u) \  --build-arg GROUP_ID=$(id -g) .echo "running tfb docker image"docker run \  -e USER_ID=$(id -u) \  --network=host \  --mount type=bind,source=$TFB_REPOPARENT/$TFB_REPONAME,target=/FrameworkBenchmarks \  techempower/tfb \  --server-host $TFB_SERVER_HOST \  --client-host $TFB_CLIENT_HOST \  --database-host $TFB_DATABASE_HOST \  --network-mode host \  --results-name "$TFB_RUN_NAME" \  --results-environment "$TFB_ENVIRONMENT" \  --results-upload-uri "$TFB_UPLOAD_URI" \  $(if [ "$TFB_RUN_ORDER" = "reverse" ]; then echo "--reverse-order"; fi) \  --quietecho "zipping the results"zip -r results.zip resultsecho "uploading the results"curl \  -i -v \  -X POST \  --header "Content-Type: application/zip" \  --data-binary @results.zip \  $TFB_UPLOAD_URIecho "done uploading results"
 |