Remove old install way
This commit is contained in:
@@ -69,7 +69,7 @@ ynh_psql_dump_db "$db_name" > db.sql
|
||||
#=================================================
|
||||
ynh_print_info "Backing up logrotate configuration..."
|
||||
|
||||
ynh_backup "/etc/logrotate.d/$app"
|
||||
#ynh_backup "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYSTEMD
|
||||
|
||||
@@ -89,13 +89,6 @@ port=$(ynh_find_port 8095)
|
||||
#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||
ynh_app_setting_set $app port $port
|
||||
|
||||
#=================================================
|
||||
# INSTALL YARN 1.13.0
|
||||
#=================================================
|
||||
ynh_print_info "Installing yarn 1.13.0..."
|
||||
|
||||
sudo apt install -y ../sources/yarn_1.13.0_all.deb
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
@@ -110,7 +103,7 @@ ynh_print_info "Installing dependencies..."
|
||||
|
||||
ynh_install_nodejs 10
|
||||
|
||||
ynh_install_app_dependencies redis-server postgresql postgresql-contrib build-essential
|
||||
ynh_install_app_dependencies postgresql postgresql-contrib
|
||||
|
||||
#=================================================
|
||||
# CREATE A POSTGRESQL DATABASE
|
||||
@@ -186,27 +179,9 @@ ynh_print_info "Configuring php-fpm ..."
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# CREATE LOG FOLDER
|
||||
# ...
|
||||
#=================================================
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app":"$app" "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# MAKE SETUP
|
||||
#=================================================
|
||||
|
||||
chown -R "$app":"$app" "$final_path"
|
||||
|
||||
pushd $final_path
|
||||
ynh_use_nodejs
|
||||
sudo -u $app env PATH=$PATH yarn cache clean
|
||||
sudo -u $app env PATH=$PATH yarn --frozen-lockfile --non-interactive
|
||||
sudo -u $app env PATH=$PATH yarn build
|
||||
ynh_secure_remove $final_path/node_modules
|
||||
sudo -u $app env PATH=$PATH yarn --production --frozen-lockfile --non-interactive
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
@@ -224,7 +199,6 @@ ynh_print_info "Configuring a systemd service ..."
|
||||
### - And the section "SETUP SYSTEMD" in the upgrade script
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
@@ -267,7 +241,6 @@ cp -f ../conf/config.sample.yml "$final_path/config.yml"
|
||||
### `ynh_replace_string` is used to replace a string in a file.
|
||||
### (It's compatible with sed regular expressions syntax)
|
||||
|
||||
#ynh_replace_string "match_string" "replace_string" "$final_path/config.yml"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config.yml"
|
||||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/config.yml"
|
||||
ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/config.yml"
|
||||
@@ -310,7 +283,7 @@ ynh_print_info "Configuring log rotation ..."
|
||||
### - And the section "SETUP LOGROTATE" in the upgrade script
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate
|
||||
#ynh_use_logrotate
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
@@ -326,7 +299,7 @@ ynh_use_logrotate
|
||||
|
||||
#yunohost service add $app --log "/var/log/$app/$app.log"
|
||||
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
|
||||
yunohost service add $app --description "$app daemon for Wiki.js" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description "$app daemon for Wiki.js" -t systemd
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
||||
@@ -62,13 +62,6 @@ ynh_remove_app_dependencies
|
||||
ynh_use_nodejs
|
||||
ynh_remove_nodejs
|
||||
|
||||
#=================================================
|
||||
# REMOVE YARN 1.13.0
|
||||
#=================================================
|
||||
ynh_print_info "Removing yarn 1.13.0..."
|
||||
|
||||
sudo apt remove -y yarn
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
@@ -99,7 +92,7 @@ ynh_print_info "Removing php-fpm configuration"
|
||||
ynh_print_info "Removing logrotate configuration"
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
#ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# CLOSE A PORT
|
||||
@@ -124,7 +117,7 @@ fi
|
||||
ynh_secure_remove "/etc/$app/"
|
||||
|
||||
# Remove the log files
|
||||
ynh_secure_remove "/var/log/$app/"
|
||||
#ynh_secure_remove "/var/log/$app/"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
||||
@@ -91,7 +91,7 @@ ynh_print_info "Reinstalling dependencies..."
|
||||
|
||||
ynh_install_nodejs 10
|
||||
|
||||
ynh_install_app_dependencies redis-server postgresql postgresql-contrib build-essential
|
||||
ynh_install_app_dependencies postgresql postgresql-contrib
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
@@ -115,7 +115,7 @@ systemctl daemon-reload
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --description "$app daemon for Wiki.js" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description "$app daemon for Wiki.js" -t systemd
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
@@ -127,7 +127,7 @@ yunohost service add $app --description "$app daemon for Wiki.js" --log "/var/lo
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/etc/logrotate.d/$app"
|
||||
#ynh_restore_file "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
@@ -139,13 +139,6 @@ ynh_print_info "Reloading nginx web server and php-fpm..."
|
||||
#systemctl reload php7.0-fpm
|
||||
systemctl reload nginx
|
||||
|
||||
#=================================================
|
||||
# CREATE LOG FOLDER
|
||||
#=================================================
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app":"$app" "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# START SERVICE
|
||||
#=================================================
|
||||
|
||||
@@ -56,6 +56,12 @@ fi
|
||||
# Remove yarn repository
|
||||
ynh_secure_remove "/etc/apt/sources.list.d/yarn.list"
|
||||
|
||||
# Remove old dependencies
|
||||
ynh_package_autoremove yarn redis-server build-essential
|
||||
|
||||
# Remove old log file
|
||||
ynh_secure_remove "/var/log/$app/"
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
@@ -102,13 +108,6 @@ ynh_print_info "Upgrading nginx web server configuration..."
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# INSTALL YARN 1.13.0
|
||||
#=================================================
|
||||
ynh_print_info "Installing yarn 1.13.0..."
|
||||
|
||||
sudo apt install -y ../sources/yarn_1.13.0_all.deb
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
@@ -116,7 +115,7 @@ ynh_print_info "Upgrading dependencies..."
|
||||
|
||||
ynh_install_nodejs 10
|
||||
|
||||
ynh_install_app_dependencies redis-server postgresql postgresql-contrib build-essential
|
||||
ynh_install_app_dependencies postgresql postgresql-contrib
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
@@ -134,21 +133,6 @@ ynh_print_info "Upgrading php-fpm configuration..."
|
||||
# Create a dedicated php-fpm config
|
||||
#ynh_add_fpm_config
|
||||
|
||||
#=================================================
|
||||
# MAKE SETUP
|
||||
#=================================================
|
||||
|
||||
chown -R "$app":"$app" "$final_path"
|
||||
|
||||
pushd $final_path
|
||||
ynh_use_nodejs
|
||||
sudo -u $app env PATH=$PATH yarn cache clean
|
||||
sudo -u $app env PATH=$PATH yarn --frozen-lockfile --non-interactive
|
||||
sudo -u $app env PATH=$PATH yarn build
|
||||
ynh_secure_remove $final_path/node_modules
|
||||
sudo -u $app env PATH=$PATH yarn --production --frozen-lockfile --non-interactive
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
@@ -158,7 +142,6 @@ cp -f ../conf/config.sample.yml "$final_path/config.yml"
|
||||
### `ynh_replace_string` is used to replace a string in a file.
|
||||
### (It's compatible with sed regular expressions syntax)
|
||||
|
||||
#ynh_replace_string "match_string" "replace_string" "$final_path/config.yml"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config.yml"
|
||||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/config.yml"
|
||||
ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/config.yml"
|
||||
@@ -175,7 +158,7 @@ ynh_store_file_checksum "$final_path/config.yml"
|
||||
ynh_print_info "Upgrading logrotate configuration..."
|
||||
|
||||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_use_logrotate --non-append
|
||||
#ynh_use_logrotate --non-append
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
@@ -183,7 +166,6 @@ ynh_use_logrotate --non-append
|
||||
ynh_print_info "Upgrading systemd configuration..."
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
|
||||
Reference in New Issue
Block a user