aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/config/states/akraino_iec
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/config/states/akraino_iec')
-rwxr-xr-xmcp/config/states/akraino_iec18
1 files changed, 13 insertions, 5 deletions
diff --git a/mcp/config/states/akraino_iec b/mcp/config/states/akraino_iec
index 4e30ca582..e61ca9451 100755
--- a/mcp/config/states/akraino_iec
+++ b/mcp/config/states/akraino_iec
@@ -1,4 +1,5 @@
#!/bin/bash -e
+# shellcheck disable=SC1090
##############################################################################
# Copyright (c) 2019 Mirantis Inc., Enea AB and others.
# All rights reserved. This program and the accompanying materials
@@ -9,18 +10,25 @@
CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
-# shellcheck disable=SC1090
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
+source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh"
IEC_REPO_URI='https://gerrit.akraino.org/r/iec'
-IEC_USER='ubuntu'
-# shellcheck disable=SC2016
-IEC_REPO_PATH=$(su - "${IEC_USER}" -c 'echo ${HOME}/iec')
+IEC_USER_L='ubuntu'
+# shellcheck disable=SC2154
+if [[ "${base_image}" =~ centos ]]; then
+ IEC_USER='centos'
+else
+ IEC_USER=${IEC_USER_L}
+fi
+IEC_REPO_PATH=/var/lib/akraino/iec
IEC_SCRIPTS_PATH="${IEC_REPO_PATH}/src/foundation/scripts"
POD_NETWORK_CIDR='100.100.0.0/16' # Avoid overlapping Fuel's PXE/admin net
-[ -e "${IEC_REPO_PATH}" ] || su - "${IEC_USER}" -c \
+# shellcheck disable=SC2174
+mkdir -p -m 777 "$(dirname ${IEC_REPO_PATH})"
+[ -e "${IEC_REPO_PATH}" ] || su - "${IEC_USER_L}" -c \
"git clone '${IEC_REPO_URI}' '${IEC_REPO_PATH}'"
# shellcheck disable=SC2086
wait_for 3.0 "! salt-cp 'iec*' -C '${IEC_REPO_PATH}/' \