Fix a bug - add requests in virtualenv 49/26749/13
authorrohitsakala <rohitsakala@gmail.com>
Fri, 6 Jan 2017 07:31:56 +0000 (13:01 +0530)
committerrohitsakala <rohitsakala@gmail.com>
Mon, 16 Jan 2017 16:54:28 +0000 (22:24 +0530)
Change-Id: Iecd20b69f7a3abf04a34d4ee7e9c94f1a039d8b1
Signed-off-by: rohitsakala <rohitsakala@gmail.com>
jjb/releng/testapi-automate.yml
utils/test/testapi/htmlize/doc-build.sh [new file with mode: 0644]
utils/test/testapi/htmlize/finish.sh
utils/test/testapi/htmlize/prepare.sh
utils/test/testapi/htmlize/push-doc-artifact.sh

index 2a2f7b6..0566c3f 100644 (file)
@@ -52,7 +52,7 @@
     name: testapi-doc-build
     builders:
         - shell: |
-            python ./utils/test/testapi/htmlize/htmlize.py -o ${WORKSPACE}/
+            bash ./utils/test/testapi/htmlize/doc-build.sh
 
 - builder:
     name: start-testapi-server
diff --git a/utils/test/testapi/htmlize/doc-build.sh b/utils/test/testapi/htmlize/doc-build.sh
new file mode 100644 (file)
index 0000000..e492c97
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Create virtual environment
+source $WORKSPACE/testapi_venv/bin/activate
+
+# Install Pre-requistics
+pip install requests
+
+python ./utils/test/testapi/htmlize/htmlize.py -o ${WORKSPACE}/
index d24ae05..dc3aa86 100644 (file)
@@ -13,5 +13,3 @@ if [ $proc_number -gt 0 ]; then
     echo "Kill opnfv-testapi server $procs"
     ps -ef | grep opnfv-testapi | grep -v grep | awk '{print $2}' | xargs kill -kill &>/dev/null
 fi
-
-deactivate
index 67158f2..e79ac56 100644 (file)
@@ -9,9 +9,6 @@
 virtualenv testapi_venv
 source testapi_venv/bin/activate
 
-# Install Pre-requisites
-pip install requests
-
 # Swgger Codegen Tool
 url="http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar"
 
index 383565d..4cf1988 100644 (file)
@@ -7,19 +7,21 @@ export PATH=$PATH:/usr/local/bin/
 
 project=$PROJECT
 workspace=$WORKSPACE
-artifact_dir="functest/docs"
+artifact_dir="$project/docs"
 
 set +e
 gsutil&>/dev/null
 if [ $? != 0 ]; then
     echo "Not possible to push results to artifact: gsutil not installed"
+    exit 1
 else
     gsutil ls gs://artifacts.opnfv.org/"$project"/ &>/dev/null
     if [ $? != 0 ]; then
         echo "Not possible to push results to artifact: gsutil not installed."
+        exit 1
     else
         echo "Uploading document to artifact $artifact_dir"
         gsutil cp "$workspace"/index.html gs://artifacts.opnfv.org/"$artifact_dir"/testapi.html >/dev/null 2>&1
-        echo "Document can be found at http://artifacts.opnfv.org/functest/docs/testapi.html"
+        echo "Document can be found at http://artifacts.opnfv.org/releng/docs/testapi.html"
     fi
 fi