Skip to content

Commit

Permalink
[patch] Fix additional config support in non-interactive install (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrercm authored Sep 20, 2023
1 parent 202a10d commit 08575d0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
Binary file removed image/cli/install-ansible/ibm-mas_devops.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion image/cli/mascli/functions/install
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function install_noninteractive() {
--manage-jdbc)
export MAS_APPWS_BINDINGS_JDBC_MANAGE=$1 && shift
;;

# Manage commands - Components
--manage-components)
export MAS_APPWS_COMPONENTS=$1 && shift
Expand Down
13 changes: 8 additions & 5 deletions image/cli/mascli/functions/pipeline_config_additional_configs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ function config_pipeline_additional_configs() {
done

echo
prompt_for_confirm "Are these the correct configuration files to apply?" || exit 0

cp $DIR/templates/additional-configs.yaml $CONFIG_DIR/additional-configs-$MAS_INSTANCE_ID.yaml
python3 $DIR/tools/cfgmgr add $CONFIG_DIR/additional-configs-$MAS_INSTANCE_ID.yaml $LOCAL_MAS_CONFIG_DIR
echo
if prompt_for_confirm "Are these the correct configuration files to apply?"; then
cp $DIR/templates/additional-configs.yaml $CONFIG_DIR/additional-configs-$MAS_INSTANCE_ID.yaml
python3 $DIR/tools/cfgmgr add $CONFIG_DIR/additional-configs-$MAS_INSTANCE_ID.yaml $LOCAL_MAS_CONFIG_DIR
echo
else
echo_warning "Additional configuration files were not confirmed! Aborting ..."
exit 0
fi
else
LOCAL_MAS_CONFIG_DIR=""
fi
Expand Down
10 changes: 10 additions & 0 deletions image/cli/mascli/functions/pipeline_config_db2
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ function db2_for_iot() {

# Check if a configuration already exists before creating a new one
jdbc_cfg_file=$LOCAL_MAS_CONFIG_DIR/jdbc-$MAS_INSTANCE_ID-system.yaml
echo "${TEXT_DIM}Searching for system database configuration file in $jdbc_cfg_file ..."
reset_colors
echo
if [ -e "$jdbc_cfg_file" ]; then
if prompt_for_confirm "System database configuration file 'jdbc-$MAS_INSTANCE_ID-system.yaml' already exists. Do you want to generate a new one?"; then
python3 $DIR/functions/gencfg jdbc $MAS_INSTANCE_ID system $jdbc_cfg_file
fi
else
echo_warning "Expected $jdbc_cfg_file file was not found, generating a valid system database configuration file now ..."
echo
python3 $DIR/functions/gencfg jdbc $MAS_INSTANCE_ID system $jdbc_cfg_file
fi
fi
Expand Down Expand Up @@ -63,11 +68,16 @@ function db2_for_manage() {

# Check if a configuration already exists before creating a new one
jdbc_cfg_file=$LOCAL_MAS_CONFIG_DIR/jdbc-$MAS_INSTANCE_ID-manage.yaml
echo "${TEXT_DIM}Searching for Manage database configuration file in $jdbc_cfg_file ..."
reset_colors
echo
if [ -e "$jdbc_cfg_file" ]; then
if prompt_for_confirm "Manage database configuration file 'jdbc-$MAS_INSTANCE_ID-manage.yaml' already exists. Do you want to generate a new one?"; then
python3 $DIR/functions/gencfg jdbc $MAS_INSTANCE_ID workspace-application $jdbc_cfg_file --workspace-id $MAS_WORKSPACE_ID --application-id manage
fi
else
echo_warning "Expected $jdbc_cfg_file file was not found, generating a valid Manage database configuration file now ..."
echo
python3 $DIR/functions/gencfg jdbc $MAS_INSTANCE_ID workspace-application $jdbc_cfg_file --workspace-id $MAS_WORKSPACE_ID --application-id manage
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions image/cli/mascli/functions/pipeline_config_kafka
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ function kafka_for_iot() {

# Check if a configuration already exists
kafka_cfg_file=$LOCAL_MAS_CONFIG_DIR/kafka-$MAS_INSTANCE_ID-system.yaml
echo "${TEXT_DIM}Searching for system Kafka configuration file in $kafka_cfg_file ..."
reset_colors
echo
if [ ! -e "$kafka_cfg_file" ]; then
echo_warning "Error: Kafka configuration file does not exist: '$kafka_cfg_file'"
Expand Down

0 comments on commit 08575d0

Please sign in to comment.