aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-19 22:38:18 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-19 22:40:15 +0200
commit99e97311529569dd78e426c3be3e46ae358b1d11 (patch)
tree9c1b84774dd0e6f0f53148c1006f5495f6304962
parent0568ff25749577fc7ef718b4e60d890365396fa6 (diff)
[deploy.sh] Prefix and export more env vars
Upcoming support for containerized Salt Master node requires access to certain variables during j2 interpolation, so also export: - MCP_STORAGE_DIR; - MCP_REPO_ROOT_PATH; JIRA: FUEL-383 Change-Id: I584c0bf8133b5ae6178d97da5b44d345e45a0222 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rwxr-xr-xci/deploy.sh27
1 files changed, 14 insertions, 13 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 07cde2613..ea8524a85 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -123,11 +123,11 @@ EOF
# BEGIN of variables to customize
#
CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
-REPO_ROOT_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")
-DEPLOY_DIR=$(cd "${REPO_ROOT_PATH}/mcp/scripts"; pwd)
-STORAGE_DIR=$(cd "${REPO_ROOT_PATH}/mcp/deploy/images"; pwd)
+MCP_REPO_ROOT_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")
+DEPLOY_DIR=$(cd "${MCP_REPO_ROOT_PATH}/mcp/scripts"; pwd)
+MCP_STORAGE_DIR=$(cd "${MCP_REPO_ROOT_PATH}/mcp/deploy/images"; pwd)
URI_REGEXP='(file|https?|ftp)://.*'
-BASE_CONFIG_URI="file://${REPO_ROOT_PATH}/mcp/scripts/pharos"
+BASE_CONFIG_URI="file://${MCP_REPO_ROOT_PATH}/mcp/scripts/pharos"
# Customize deploy workflow
DRY_RUN=${DRY_RUN:-0}
@@ -199,7 +199,7 @@ do
;;
S)
if [[ ${OPTARG} ]]; then
- STORAGE_DIR="${OPTARG}"
+ MCP_STORAGE_DIR="${OPTARG}"
fi
;;
h)
@@ -251,7 +251,7 @@ fi
./sysinfo_print.sh
# Clone git submodules and apply our patches
-make -C "${REPO_ROOT_PATH}/mcp/patches" deepclean patches-import
+make -C "${MCP_REPO_ROOT_PATH}/mcp/patches" deepclean patches-import
# Check scenario file existence
SCENARIO_DIR="$(readlink -f "../config/scenario")"
@@ -266,11 +266,12 @@ export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")"
MCP_DPDK_MODE=$([[ "$DEPLOY_SCENARIO" =~ ovs ]] && echo 1 || echo 0)
# Expand jinja2 templates based on PDF data and env vars
-export MCP_VCP MCP_DPDK_MODE MCP_JUMP_ARCH=$(uname -i)
-do_templates_scenario "${STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
+export MCP_REPO_ROOT_PATH MCP_VCP MCP_DPDK_MODE MCP_STORAGE_DIR \
+ MCP_JUMP_ARCH=$(uname -i)
+do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
"${BASE_CONFIG_URI}" "${SCENARIO_DIR}"
-do_templates_cluster "${STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
- "${REPO_ROOT_PATH}" \
+do_templates_cluster "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
+ "${MCP_REPO_ROOT_PATH}" \
"${SCENARIO_DIR}/defaults.yaml" \
"${SCENARIO_DIR}/${DEPLOY_SCENARIO}.yaml"
@@ -289,18 +290,18 @@ elif [ ${USE_EXISTING_INFRA} -gt 0 ]; then
notify "[NOTE] Use existing infra" 2
check_connection
else
- prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_repos_pkgs}" \
+ prepare_vms "${base_image}" "${MCP_STORAGE_DIR}" "${virtual_repos_pkgs}" \
"${virtual_nodes[@]}"
create_networks "${OPNFV_BRIDGES[@]}"
do_sysctl_cfg
do_udev_cfg
- create_vms "${STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}"
+ create_vms "${MCP_STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}"
update_mcpcontrol_network
start_vms "${virtual_nodes[@]}"
check_connection
fi
if [ ${USE_EXISTING_INFRA} -lt 2 ]; then
- wait_for 5 "./salt.sh ${STORAGE_DIR}/pod_config.yml ${virtual_nodes[*]}"
+ wait_for 5 "./salt.sh ${MCP_STORAGE_DIR}/pod_config.yml ${virtual_nodes[*]}"
fi
# Openstack cluster setup