From: Victor Morales Date: Mon, 5 Oct 2020 22:42:01 +0000 (-0400) Subject: Add yq checker X-Git-Tag: opnfv-10.0.0~9 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=kuberef.git;a=commitdiff_plain;h=84f092e7961684bc9125aa7740c56ceb6811798c Add yq checker The yq parser is required by the deploy.env file to extract values from PDF and IDF files. This change ensures that binary is present. Signed-off-by: Victor Morales Change-Id: I5400bc4910ea88da74fab188bf1cfdbebe3cbed1 Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71230 Tested-by: jenkins-ci Reviewed-by: Rihab Banday Reviewed-by: Georg Kunz --- diff --git a/deploy.sh b/deploy.sh index 2b1e3ce..5a012e7 100755 --- a/deploy.sh +++ b/deploy.sh @@ -19,9 +19,6 @@ set -o nounset CURRENTPATH=$(git rev-parse --show-toplevel) export CURRENTPATH -# Source env variables & functions -# shellcheck source=./deploy.env -source "$CURRENTPATH/deploy.env" # shellcheck source=./functions.sh source "$CURRENTPATH/functions.sh" @@ -30,6 +27,9 @@ source "$CURRENTPATH/functions.sh" # --------------------------------------------------------------------- check_prerequisites +# shellcheck source=./deploy.env +source "$CURRENTPATH/deploy.env" + # --------------------------------------------------------------------- # bootstrap install prerequisites # --------------------------------------------------------------------- diff --git a/functions.sh b/functions.sh index 25f76ea..f0e1213 100755 --- a/functions.sh +++ b/functions.sh @@ -49,6 +49,14 @@ check_prerequisites() { exit 1 fi + #------------------------------------------------------------------------------- + # Check is yq is installed + #------------------------------------------------------------------------------- + if ! command -v yq &> /dev/null; then + echo "ERROR : yq not found. Please install." + exit 1 + fi + #------------------------------------------------------------------------------- # Check is libvirt is installed #-------------------------------------------------------------------------------