mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
cleaning
This commit is contained in:
parent
6ba379cb87
commit
f017241658
5 changed files with 20 additions and 20 deletions
|
@ -35,7 +35,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
|||
#=================================================
|
||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
|
||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=48
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
|
@ -117,7 +117,7 @@ systemctl daemon-reload
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=16
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING"
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=20
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=48
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
@ -93,7 +93,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# CREATE A MONGODB DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a MongoDB database..." --weight=2
|
||||
ynh_script_progression --message="Creating a MongoDB database..." --weight=5
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
|
@ -103,7 +103,7 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --weight=2
|
||||
ynh_script_progression --message="Setting up source files..." --weight=10
|
||||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
|
@ -119,7 +119,7 @@ chown -R $app:$app "/tmp/ufs"
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=3
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
@ -129,7 +129,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# CONFIGURE MONGOD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring mongod..." --weight=1
|
||||
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: rs01" --target_file="/etc/mongod.conf"
|
||||
|
@ -144,7 +144,7 @@ fi
|
|||
#==============================================
|
||||
# INSTALL ROCKETCHAT
|
||||
#==============================================
|
||||
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=20
|
||||
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=29
|
||||
|
||||
pushd $final_path/programs/server
|
||||
ynh_use_nodejs
|
||||
|
@ -179,7 +179,7 @@ yunohost service add $app --description="Team collaboration communication platfo
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=29
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="SERVER RUNNING"
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ ynh_remove_logrotate
|
|||
#=================================================
|
||||
# REMOVE THE MONGODB DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the MongoDB database..." --weight=3
|
||||
ynh_script_progression --message="Removing the MongoDB database..." --weight=11
|
||||
|
||||
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"
|
||||
|
@ -68,7 +68,7 @@ ynh_mongo_remove_db --db_user=$db_user --db_name=$db_name
|
|||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing app main directory..." --weight=1
|
||||
ynh_script_progression --message="Removing app main directory..." --weight=2
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
@ -88,7 +88,7 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=4
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
|
|
|
@ -68,7 +68,7 @@ chown -R $app:$app "$final_path"
|
|||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=40
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
@ -86,7 +86,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
# RESTORE THE MONGODB DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MongoDB database..." --weight=3
|
||||
ynh_script_progression --message="Restoring the MongoDB database..." --weight=10
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
|
@ -95,7 +95,7 @@ ynh_mongo_restore_db --database="$db_name" < ./dump.bson
|
|||
#=================================================
|
||||
# CONFIGURE MONGOD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring mongod..." --weight=3
|
||||
ynh_script_progression --message="Configuring mongod..." --weight=7
|
||||
|
||||
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: rs01" --target_file="/etc/mongod.conf"
|
||||
|
@ -132,7 +132,7 @@ yunohost service add $app --description="Team collaboration communication platfo
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=5
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=19
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING"
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=45
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
|
@ -95,7 +95,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=22
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
|
@ -144,7 +144,7 @@ fi
|
|||
#==============================================
|
||||
# INSTALL ROCKETCHAT
|
||||
#==============================================
|
||||
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=20
|
||||
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=29
|
||||
|
||||
pushd $final_path/programs/server
|
||||
ynh_use_nodejs
|
||||
|
@ -179,7 +179,7 @@ yunohost service add $app --description="Team collaboration communication platfo
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=10
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=19
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING"
|
||||
|
||||
|
|
Loading…
Reference in a new issue