Only Submit Security Scan Results that Exist
[releng.git] / jjb / releng / 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="$project/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     exit 1
17 else
18     gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null
19     if [ $? != 0 ]; then
20         echo "Not possible to push results to artifact: gsutil not installed."
21         exit 1
22     else
23         echo "Uploading document to artifact $artifact_dir"
24         gsutil cp "$workspace"/index.html gs://artifacts.opnfv.org/"$artifact_dir"/testapi.html >/dev/null 2>&1
25         echo "Document can be found at http://artifacts.opnfv.org/releng/docs/testapi.html"
26     fi
27 fi