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=${1:-$(date -u +"%Y-%m-%d_%H-%M-%S")}
18 branch=${GIT_BRANCH##*/}
20 dir_result="${HOME}/opnfv/$project/results/$branch"
22 'opnfv-jump-1' 'opnfv-jump-2' 'ericsson-pod1' 'ericsson-pod2' \
23 'intelpod2-jumphost' 'intel-pod3' 'intel-pod5' 'intel-pod6' \
24 'intel-pod8' 'huawei-us-deploy-bare-1' 'orange-fr-pod2')
26 if [[ ! " ${node_list[@]} " =~ " ${testbed} " ]]; then
27 echo "This is not a CI POD. Aborting pushing the logs to artifacts."
31 if [[ "$branch" == "master" ]]; then
32 project_artifact=logs/$project/$testbed/$res_build_date
34 project_artifact=logs/$project/$testbed/$branch/$res_build_date
37 # create the folder to store the results
40 # copy folder to artifact
41 if [ -d "$dir_result" ]; then
42 if [ "$(ls -A $dir_result)" ]; then
46 echo "Not possible to push results to artifact: gsutil not installed";
48 gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null
50 echo "Not possible to push results to artifact: gsutil not installed.";
52 echo "copy result files to artifact $project_artifact"
53 gsutil -m cp -r "$dir_result" gs://artifacts.opnfv.org/"$project_artifact"/
57 echo "Result folder is empty"