X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fengine%2Fscripts%2Fdeploy.sh;h=1f0f7b16118446f07c771a0bc876e733e6616284;hb=24eaec5b71aa5f80e147731d7204c86f0dbd4a2b;hp=0f4ab73d272588916685f33b6e2294d6a3632334;hpb=7a40c76d50eb74886c849b05958fd0f420499688;p=infra%2Fcicd.git diff --git a/jjb/engine/scripts/deploy.sh b/jjb/engine/scripts/deploy.sh index 0f4ab73d..1f0f7b16 100755 --- a/jjb/engine/scripts/deploy.sh +++ b/jjb/engine/scripts/deploy.sh @@ -18,13 +18,24 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= -set -o nounset set -o errexit set -o pipefail -if [[ "$EXECUTION_MODE" == "offline-deployment" && "$PROVISIONER_TYPE" == "heat" ]]; then - echo "Info : Offline deployments on cloud instances is not currently supported!" - exit 0 +# NOTE (fdegir): we need to remove $WORKSPACE and clone infra/engine repository +# as infra/engine is what drives the deployment +if [[ "$GERRIT_PROJECT" != "infra/engine" ]]; then + cd "$HOME" && /bin/rm -rf "$WORKSPACE" + echo "Info : Cloning infra/engine repository" + git clone -q https://gerrit.nordix.org/infra/engine.git "$WORKSPACE" + cd "$WORKSPACE" +fi + +# NOTE (fdegir): this variable is set by generate-change-metadata.sh script +# if a dependency to engine repo is determined so we check out that refspec +# to ensure we respect the dependency +if [[ ! -z "${NORDIX_ENGINE_REFSPEC+x}" ]]; then + echo "Info : Fetching dependent change ${NORDIX_ENGINE_REFSPEC} infra/engine" + git fetch "https://gerrit.nordix.org/infra/engine" ${NORDIX_ENGINE_REFSPEC} && git checkout FETCH_HEAD fi if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then @@ -37,9 +48,13 @@ fi OPENRC_FILE=${OPENRC_FILE:-/tmp/openrc} HEAT_ENVIRONMENT_FILENAME=${HEAT_ENVIRONMENT_FILENAME:-/tmp/heat} -[[ ${PROVISIONER_TYPE} == "heat" ]] && /bin/cp -f $OPENRC_FILE /tmp/openrc +/bin/cp -f $OPENRC_FILE /tmp/openrc cd "$ENGINE_ROOT_DIR/engine" -./deploy.sh -d "$INSTALLER_TYPE" -s "$DEPLOY_SCENARIO" -b "file://$ENGINE_ROOT_DIR/engine/inventory/group_vars/all/sdf.yaml" \ - -r "$PROVISIONER_TYPE" -p "$PDF" -i "$IDF" -u /tmp/openrc \ - -e "file://$ENGINE_ROOT_DIR/engine/provisioner/heat/playbooks/roles/bootstrap-hwconfig/files/$HEAT_ENVIRONMENT_FILENAME" +./deploy.sh -s "$STACK_TYPE" -b "$STACK_VERSION" -c "$DEPLOY_SCENARIO" -p "$PDF" -i "$IDF" -o /tmp/openrc -d "$DISTRO" -v + +# NOTE (fdegir): we need inventory.ini for test execution +/bin/rm -f /tmp/inventory.ini +/bin/cp -f /opt/engine/.cache/config/inventory.ini /tmp/inventory.ini + +# vim: set ts=2 sw=2 expandtab: