- local global_prefix="deploy_global_params_"
- local options_prefix="deploy_deploy_options_"
- local myvar myvalue
- local settings=$(parse_yaml $DEPLOY_SETTINGS_FILE "deploy_")
-
- for this_setting in $settings; do
- if contains_prefix $this_setting $global_prefix; then
- myvar=$(parse_setting_var $this_setting $global_prefix)
- if [ -z "$myvar" ]; then
- echo -e "${red}ERROR: while parsing ${DEPLOY_SETTINGS_FILE} for setting: ${this_setting}${reset}"
- fi
- myvalue=$(parse_setting_value $this_setting)
- # Do not override variables set by cmdline
- if [ -z "$(eval echo \$$myvar)" ]; then
- eval "$myvar=\$myvalue"
- echo -e "${blue}Global parameter set: ${myvar}:${myvalue}${reset}"
- else
- echo -e "${blue}Global parameter already set: ${myvar}${reset}"
- fi
- elif contains_prefix $this_setting $options_prefix; then
- myvar=$(parse_setting_var $this_setting $options_prefix)
- if [ -z "$myvar" ]; then
- echo -e "${red}ERROR: while parsing ${DEPLOY_SETTINGS_FILE} for setting: ${this_setting}${reset}"
- fi
- myvalue=$(parse_setting_value $this_setting)
- deploy_options_array[$myvar]=$myvalue
- echo -e "${blue}Deploy option set: ${myvar}:${myvalue}${reset}"
- fi
- done
+ local output
+ if output=$(python3.4 -B $LIB/python/apex-python-utils.py parse-deploy-settings -f $DEPLOY_SETTINGS_FILE); then
+ echo -e "${blue}${output}${reset}"
+ eval "$output"
+ else
+ echo -e "${red}ERROR: Failed to parse deploy settings file $DEPLOY_SETTINGS_FILE ${reset}"
+ exit 1
+ fi