diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-09-08 17:08:59 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-09-13 15:48:48 +0800 |
commit | 2bf95e68a19fc3a7c1e3236a977b1d3b6db1c05c (patch) | |
tree | c533c1182ffa2314c95c82edf44b9475f8e7f294 /tests/ci/utils | |
parent | 4154a75853f6ba004de775194ebffbe00b591012 (diff) |
Refactor CI scripts
- Move scripts executed inside container to qtip/scripts
- tests/ci is limited to setup the environment and start services
Change-Id: I454c715890601c6c6472006c2f0f6131695c2f51
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'tests/ci/utils')
-rw-r--r-- | tests/ci/utils/start_services.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ci/utils/start_services.sh b/tests/ci/utils/start_services.sh new file mode 100644 index 00000000..78bc2970 --- /dev/null +++ b/tests/ci/utils/start_services.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# detect installer_ip +case ${INSTALLER_TYPE} in + apex) + export INSTALLER_IP=$(sudo virsh domifaddr undercloud | grep ipv4 | awk '{print $4}' | cut -d/ -f1) + ;; +esac + +export ENV_FILE="${ENV_FILE:-$(pwd)/env_file}" +cat << EOF > $ENV_FILE +INSTALLER_TYPE=${INSTALLER_TYPE} +INSTALLER_IP=${INSTALLER_IP} +TEST_SUITE=${TEST_SUITE} +NODE_NAME=${NODE_NAME:-opnfv-pod} +SCENARIO=${DEPLOY_SCENARIO:-generic} +TESTAPI_URL=${TESTAPI_URL:-} +EOF + +TMPFILE=`mktemp /tmp/qtip.XXXXXX` || exit 1 +curl https://git.opnfv.org/releng/plain/utils/fetch_os_creds.sh | bash -s -- \ + -i ${INSTALLER_TYPE} -a ${INSTALLER_IP} -d ${TMPFILE} +grep "export" ${TMPFILE} | sed "s/export //" >> $ENV_FILE +# eliminate warning message "Invalid -W option ignored: invalid action: '"ignore'" +sed -i '/^PYTHONWARNINGS=/d' $ENV_FILE + +docker-compose -f $script_dir/${TEST_SUITE}/docker-compose.yaml pull +docker-compose -f $script_dir/${TEST_SUITE}/docker-compose.yaml up -d |