From: Ciprian Barbu Date: Mon, 3 Aug 2020 12:14:03 +0000 (+0300) Subject: Refactor SEBA install.sh X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=bba2e4db70d9f5b39845e991020db05de4d03b62;p=iec.git Refactor SEBA install.sh Minor changes for supporting older git versions without -C parameter. Also do some cleanup and remove HELM_CHARTS_REV from env, since the next step in automation-tools will find the helm-charts repo and will not need this variable anyway. Signed-off-by: Ciprian Barbu Change-Id: I23d9871e9f5ec30a70cff1b5bf4382a4bd513fcf --- diff --git a/src/use_cases/seba_on_arm/test/ponsim/install.sh b/src/use_cases/seba_on_arm/test/ponsim/install.sh index 9d31604..eaa97d4 100755 --- a/src/use_cases/seba_on_arm/test/ponsim/install.sh +++ b/src/use_cases/seba_on_arm/test/ponsim/install.sh @@ -3,10 +3,6 @@ set -ex -basepath="$(cd "$(dirname "$(readlink -f "$0")")"; pwd)" - -IEC_PATH="$(readlink -f "$(git -C "${basepath}" rev-parse --show-toplevel)")" -HELM_CHARTS_PATH="src/use_cases/seba_on_arm/src_repo/helm-charts" HELM_CHARTS_REV_IEC="cord-7.0-arm64" HELM_CHARTS_REV_REC="cord-7.0-arm64-rec" UPSTREAM_PROJECT="${UPSTREAM_PROJECT:-iec}" @@ -31,7 +27,6 @@ esac export M="/tmp/milestones" export WORKSPACE="${HOME}" -export HELM_CHARTS_REV export SEBAVALUES # Using opencord automation-tools from the cord-6.1 maintenance branch @@ -42,18 +37,20 @@ AUTO_TOOLS_REV="${AUTO_TOOLS_VER:-cord-7.0-arm64}" rm -rf "${M}" mkdir -p "${M}" "${WORKSPACE}/cord/test" -# Update helm-charts submdule needed later -# ignore subproject commit and use latest remote version -git -C "${IEC_PATH}" submodule update --init --remote "${HELM_CHARTS_PATH}" -git -C "${IEC_PATH}/${HELM_CHARTS_PATH}" checkout "${HELM_CHARTS_REV}" - -test -d "${AUTO_TOOLS}" || git clone "${AUTO_TOOLS_REPO}" "${AUTO_TOOLS}" -git -C "${AUTO_TOOLS}" checkout "${AUTO_TOOLS_REV}" +if ! [ -d "${AUTO_TOOLS}" ] && ! [ -L "${AUTO_TOOLS}" ] +then + git clone "${AUTO_TOOLS_REPO}" "${AUTO_TOOLS}" + (cd "${AUTO_TOOLS}"; git checkout "${AUTO_TOOLS_REV}") +fi -# Faking helm-charts repo clone to our own git submodule if not already there +# Use our own helm-charts clone if not already there CHARTS="${WORKSPACE}/cord/helm-charts" -test -d "${CHARTS}" || test -L "${CHARTS}" || \ - ln -s "${IEC_PATH}/${HELM_CHARTS_PATH}" "${CHARTS}" +HELM_CHARTS_REPO="https://github.com/iecedge/helm-charts.git" +if ! [ -d "${CHARTS}" ] && ! [ -L "${CHARTS}" ] +then + git clone "${HELM_CHARTS_REPO}" "${CHARTS}" + (cd "${CHARTS}"; git checkout "${HELM_CHARTS_REV}") +fi cd "${AUTO_TOOLS}/seba-in-a-box" # shellcheck source=/dev/null