Adapt engine-verify jobs for engine refactoring
[infra/cicd.git] / jjb / engine / scripts / deploy.sh
index 56010749b6965ea4df69c874185c592d72b4421a..0589a8274ff57ac064a7d82995b90ccee4f2725c 100755 (executable)
@@ -22,15 +22,13 @@ 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
-fi
-
-if [[ "$GERRIT_PROJECT" == "infra/installer/kolla" ]]; then
-  echo "Info  : Setting installer to kolla and scenario to os-nosdn-nofeature"
-  export INSTALLER_TYPE="kolla"
-  export DEPLOY_SCENARIO="os-nosdn-nofeature"
+# 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
 
 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
@@ -39,13 +37,19 @@ else
   ENGINE_ROOT_DIR="$WORKSPACE"
 fi
 
+# TODO (fdegir): this is temporarily here to develop the jobs
+if [[ "$GERRIT_PROJECT" != "infra/engine" ]]; then
+  cd $ENGINE_ROOT_DIR
+  git fetch "https://gerrit.nordix.org/infra/engine" refs/changes/23/4823/18 && git checkout FETCH_HEAD
+fi
+
 # NOTE (fdegir): for bifrost based deployments, we don't need these files so we fake them
 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 -d -s "$STACK_TYPE" -v "$STACK_VERSION" -p "$PDF" -i "$IDF" -o /tmp/openrc
+
+# vim: set ts=2 sw=2 expandtab: