Merge "Create Jenkins Job for testapi automation"
[releng.git] / utils / test / testapi / htmlize / push-doc-artifact.sh
1 #!/bin/bash
2
3 set -e
4 set -o pipefail
5
6 export PATH=$PATH:/usr/local/bin/
7
8 project=$PROJECT
9 workspace=$WORKSPACE
10 artifact_dir="functest/docs"
11
12 set +e
13 gsutil&>/dev/null
14 if [ $? != 0 ]; then
15     echo "Not possible to push results to artifact: gsutil not installed"
16 else
17     gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null
18     if [ $? != 0 ]; then
19         echo "Not possible to push results to artifact: gsutil not installed."
20     else
21         echo "Uploading document to artifact $artifact_dir"
22         gsutil cp "$workspace"/index.html gs://artifacts.opnfv.org/"$artifact_dir"/testapi.html >/dev/null 2>&1
23         echo "Document can be found at http://artifacts.opnfv.org/functest/docs/testapi.html"
24     fi
25 fi