2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Orange and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 export PATH=$PATH:/usr/local/bin/
15 git_sha1="$(git rev-parse HEAD)"
16 res_build_date=$(date -u +"%Y-%m-%d_%H-%M-%S")
18 # Result directory in the jumphost
19 # to be used only with CI
20 dir_result="${HOME}/opnfv/functest/results"
22 # Clean the results directory
23 # remove json file for rally, export only html
24 # json should have been pushed into the DB
25 rm -f $dir_result/rally/*.json
27 # Several information are required: date and testbed
28 # date is generated by functest so on the artifact, the results shall be under functest/<testbed id>/date/
31 project_artifact=logs/functest/$testbed/$res_build_date
33 # copy folder to artifact
34 if [ -d "$dir_result" ]; then
35 if [ "$(ls -A $dir_result)" ]; then
36 echo "copy result files to artifact $project_artifact"
37 gsutil -m cp -r "$dir_result" gs://artifacts.opnfv.org/"$project_artifact"/
39 # delete local results
40 # should not be useful as the container is about to die...just in case
41 rm -Rf /home/opnfv/functest/results/*
43 echo "Result folder is empty"
46 echo "No result folder found"