5 project="$(git remote -v | head -n1 | awk '{{print $2}}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')"
6 export PATH=$PATH:/usr/local/bin/
8 git_sha1="$(git rev-parse HEAD)"
9 res_build_date=$(date -u +"%Y-%m-%d_%H-%M-%S")
11 # set once, functe config file could be use to avoid such hardcoded path
12 dir_result="$HOME/functest/results"
14 # Several information are required: date and testbed
15 # date is generated by functest so on the artifact, the results shall be under functest/<testbed id>/date/
17 project_artifact=$project/$testbed/$res_build_date
19 # copy folder to artifact
20 if [ -d "$dir_result" ]; then
21 if [ "$(ls -A $dir_result)" ]; then
22 echo "copy result files to artifact $project_artifact"
23 gsutil cp -r "$dir_result" gs://artifacts.opnfv.org/"$project_artifact"/
25 echo "Result folder is empty"
28 echo "No result folder found"