From 247f31321890180dca6f2300b7b065c70a0b7132 Mon Sep 17 00:00:00 2001 From: xudan16 Date: Tue, 1 Mar 2022 15:21:56 +0800 Subject: Update deployment guide doc After trying to deploy with vms, find some errors and additional requirements that need to be added into the deployment guide. Also add some minor updates in function.sh. Signed-off-by: xudan16 Change-Id: I91f1d4efb28178c79d6a68f011da2b165633f345 Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/73233 Tested-by: jenkins-ci Reviewed-by: Rihab Banday Reviewed-by: Kanagaraj Manickam Reviewed-by: Michael Pedersen Reviewed-by: Georg Kunz --- functions.sh | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'functions.sh') diff --git a/functions.sh b/functions.sh index 73f3d27..c4690ef 100755 --- a/functions.sh +++ b/functions.sh @@ -160,6 +160,12 @@ copy_files_jump() { # Host Provisioning provision_hosts_baremetal() { + if [ "${DEBUG:-false}" == "true" ]; then + DEBUG_FLAG="-v" + else + DEBUG_FLAG="" + fi + # shellcheck disable=SC2087 ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF # Install and run cloud-infra @@ -170,24 +176,29 @@ fi cp "${PROJECT_ROOT}"/"${VENDOR}"/{pdf.yaml,idf.yaml} \ "${PROJECT_ROOT}"/engine/engine cd "${PROJECT_ROOT}"/engine/engine || return -./deploy.sh -s ironic -d "${DISTRO}" \ +./deploy.sh -s ironic "${DEBUG_FLAG}" -d "${DISTRO}" \ -p file:///"${PROJECT_ROOT}"/engine/engine/pdf.yaml \ -i file:///"${PROJECT_ROOT}"/engine/engine/idf.yaml EOF } provision_hosts_vms() { + if [ "${DEBUG:-false}" == "true" ]; then + DEBUG_FLAG="-v" + else + DEBUG_FLAG="" + fi + # shellcheck disable=SC2087 -# Install and run cloud-infra -if [ ! -d "$CURRENTPATH/engine" ]; then - git clone https://gerrit.nordix.org/infra/engine.git "${CURRENTPATH}"/engine -fi -cp "$CURRENTPATH"/hw_config/"$VENDOR"/{pdf.yaml,idf.yaml} \ -"${CURRENTPATH}"/engine/engine -cd "$CURRENTPATH"/engine/engine || return -./deploy.sh -s ironic \ --p file:///"${CURRENTPATH}"/engine/engine/pdf.yaml \ --i file:///"${CURRENTPATH}"/engine/engine/idf.yaml + # Install and run cloud-infra + if [ ! -d "${CURRENTPATH}/engine" ]; then + git clone https://gerrit.nordix.org/infra/engine.git "${CURRENTPATH}"/engine + fi + cp "${CURRENTPATH}"/hw_config/"${VENDOR}"/{pdf.yaml,idf.yaml} "${CURRENTPATH}"/engine/engine + cd "${CURRENTPATH}"/engine/engine || return + ./deploy.sh -s ironic "${DEBUG_FLAG}" \ + -p file:///"${CURRENTPATH}"/engine/engine/pdf.yaml \ + -i file:///"${CURRENTPATH}"/engine/engine/idf.yaml } # Setup networking on provisioned hosts (Adapt setup_network.sh according to your network setup) @@ -328,7 +339,7 @@ EOF # Creates a python virtual environment creates_virtualenv() { if [ ! -d "$CURRENTPATH/.venv" ]; then - virtualenv .venv + virtualenv "$CURRENTPATH/.venv" fi # shellcheck disable=SC1090 source "$CURRENTPATH/.venv/bin/activate" -- cgit 1.2.3-korg