Fetch admin.conf from master on kubernetes scenario 55/40355/1
authorchenjiankun <chenjiankun1@huawei.com>
Mon, 28 Aug 2017 08:48:11 +0000 (08:48 +0000)
committerchenjiankun <chenjiankun1@huawei.com>
Mon, 28 Aug 2017 08:48:11 +0000 (08:48 +0000)
Now we have joid deploy kubernetes scenario
We need admin.conf when run test case
We can fetch admin.conf by:
    juju scp kubernetes-master/0:config admin.conf
Also we need a jenkins job to fetch it.

Change-Id: I13a6a17ca13e247cfc50774bf5104480fc03631a
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
jjb/yardstick/yardstick-daily-jobs.yml
jjb/yardstick/yardstick-daily.sh
jjb/yardstick/yardstick-get-k8s-conf.sh [new file with mode: 0755]

index 39935ab..4536543 100644 (file)
             description: "POD: $NODE_NAME"
         - 'yardstick-cleanup'
         - 'yardstick-fetch-os-creds'
+        - 'yardstick-fetch-k8s-conf'
         - 'yardstick-{testsuite}'
         - 'yardstick-store-results'
 
         - shell:
             !include-raw: ../../utils/fetch_os_creds.sh
 
+- builder:
+    name: yardstick-fetch-k8s-conf
+    builders:
+        - shell:
+            !include-raw: ./yardstick-get-k8s-conf.sh
+
 - builder:
     name: yardstick-store-results
     builders:
 - trigger:
     name: 'yardstick-daily-huawei-pod4-trigger'
     triggers:
-        - timed: ''
\ No newline at end of file
+        - timed: ''
index 56d0874..ccee971 100755 (executable)
@@ -19,11 +19,15 @@ if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
 fi
 
 if [[ ${INSTALLER_TYPE} == 'joid' ]]; then
-    # If production lab then creds may be retrieved dynamically
-    # creds are on the jumphost, always in the same folder
-    rc_file_vol="-v $LAB_CONFIG/admin-openrc:/etc/yardstick/openstack.creds"
-    # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
-    # replace the default one by the customized one provided by jenkins config
+    if [[ "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then
+        rc_file_vol="-v $LAB_CONFIG/admin.conf:/etc/yardstick/admin.conf"
+    else
+        # If production lab then creds may be retrieved dynamically
+        # creds are on the jumphost, always in the same folder
+        rc_file_vol="-v $LAB_CONFIG/admin-openrc:/etc/yardstick/openstack.creds"
+        # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
+        # replace the default one by the customized one provided by jenkins config
+    fi
 elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then
     cacert_file_vol="-v ${HOME}/os_cacert:/etc/yardstick/os_cacert"
     echo "export OS_CACERT=/etc/yardstick/os_cacert" >> ${HOME}/opnfv-openrc.sh
diff --git a/jjb/yardstick/yardstick-get-k8s-conf.sh b/jjb/yardstick/yardstick-get-k8s-conf.sh
new file mode 100755 (executable)
index 0000000..ce1e94d
--- /dev/null
@@ -0,0 +1,7 @@
+set -e
+
+dest_path="$HOME/admin.conf"
+
+if [[ "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then
+    juju scp kubernetes-master/0:config "${dest_path}"
+fi