Remove old install way
This commit is contained in:
@@ -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