diff --git a/scripts/install b/scripts/install index 33a92d2..5eebfaa 100755 --- a/scripts/install +++ b/scripts/install @@ -123,15 +123,13 @@ cp "$install_dir/build/package-lock.json" "$install_dir/live/package-lock.json" cp -r "$install_dir/build/libraries/" "$install_dir/live/libraries/" cp -r "$install_dir/build/services/" "$install_dir/live/services/" cp -r "$install_dir/build/patches/" "$install_dir/live/patches/" +cp -r "$install_dir/build/server-ce/config" "$install_dir/config/" +ynh_secure_remove --file="$install_dir/config/settings.js" ynh_add_config --template="../conf/production.json" --destination="$install_dir/build/server-ce/config/production.json" -cp -r "$install_dir/build/server-ce/config" "$install_dir/config/" -cp -r "$install_dir/build/server-ce/config/" "$install_dir/live/services/history-v1/config/" +ynh_add_config --template="../conf/production.json" --destination="$install_dir/live/services/history-v1/config/production.json" +cp "$install_dir/build/server-ce/config/custom-environment-variables.json" "$install_dir/live/services/history-v1/config/" -ynh_store_file_checksum --file="$install_dir/config/production.json" -ynh_store_file_checksum --file="$install_dir/live/services/history-v1/config/production.json" - -ynh_secure_remove --file="$install_dir/config/settings.js" ynh_secure_remove --file="$install_dir/build" ynh_script_progression --message="Building app..." @@ -226,4 +224,4 @@ ynh_systemd_action --service_name="$app-web" --action="start" --log_path="/var/l # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" \ No newline at end of file diff --git a/scripts/remove b/scripts/remove index 3f6d0bc..49831f8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -111,7 +111,6 @@ ynh_script_progression --message="Removing the MongoDB database..." # Remove a database if it exists, along with the associated user ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name -ynh_replace_string --match_string="engine: wiredTiger" --replace_string="# engine:" --target_file="/etc/mongod.conf" ynh_replace_string --match_string="replication:" --replace_string="#replication:" --target_file="/etc/mongod.conf" ynh_replace_string --match_string=" replSetName: rs0" --replace_string="" --target_file="/etc/mongod.conf" diff --git a/scripts/restore b/scripts/restore index de25dca..b9284b1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,7 +37,6 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= ynh_script_progression --message="Configuring MongoDB..." --weight=10 -ynh_replace_string --match_string="# engine:" --replace_string=" engine: wiredTiger" --target_file="/etc/mongod.conf" ynh_replace_string --match_string="#replication:" --replace_string="replication:\n replSetName: rs0" --target_file="/etc/mongod.conf" ynh_exec_warn_less systemctl enable mongod --quiet diff --git a/scripts/upgrade b/scripts/upgrade index bdf15c4..71ba3d1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,6 @@ ynh_script_progression --message="Ensuring downward compatibility..." #================================================= ynh_script_progression --message="Configuring MongoDB..." --weight=10 -ynh_replace_string --match_string="# engine:" --replace_string=" engine: wiredTiger" --target_file="/etc/mongod.conf" ynh_replace_string --match_string="#replication:" --replace_string="replication:\n replSetName: rs0" --target_file="/etc/mongod.conf" ynh_exec_warn_less systemctl enable mongod --quiet @@ -123,17 +122,19 @@ chown $app:$app "$install_dir/settings.js" ynh_script_progression --message="Preparing app..." mkdir -p "$install_dir/live" +cp "$install_dir/build/server-ce/genScript.js" "$install_dir/live/genScript.js" +cp "$install_dir/build/server-ce/services.js" "$install_dir/live/services.js" cp "$install_dir/build/package.json" "$install_dir/live/package.json" cp "$install_dir/build/package-lock.json" "$install_dir/live/package-lock.json" cp -r "$install_dir/build/libraries/" "$install_dir/live/libraries/" cp -r "$install_dir/build/services/" "$install_dir/live/services/" cp -r "$install_dir/build/patches/" "$install_dir/live/patches/" +cp -r "$install_dir/build/server-ce/config" "$install_dir/config/" +ynh_secure_remove --file="$install_dir/config/settings.js" ynh_add_config --template="../conf/production.json" --destination="$install_dir/build/server-ce/config/production.json" -cp -r "$install_dir/build/server-ce/config/" "$install_dir/config/" -cp -r "$install_dir/build/server-ce/config/" "$install_dir/live/services/history-v1/config/" - -ynh_secure_remove --file="$install_dir/build" +ynh_add_config --template="../conf/production.json" --destination="$install_dir/live/services/history-v1/config/production.json" +cp "$install_dir/build/server-ce/config/custom-environment-variables.json" "$install_dir/live/services/history-v1/config/" ynh_script_progression --message="Building app..." pushd "$install_dir/live"