mirror of
https://github.com/YunoHost-Apps/weblate_ynh.git
synced 2024-10-01 13:35:04 +02:00
set weight
This commit is contained in:
parent
df68a48f42
commit
cedddd92df
6 changed files with 69 additions and 69 deletions
|
@ -5,7 +5,7 @@
|
|||
################################################################################
|
||||
|
||||
# Please do not modify this file, it will be reset at the next update.
|
||||
# You can edit the file /var/www/weblate/local_settings.py and add/modify the settings you need.
|
||||
# You can edit the file __FINALPATH__/local_settings.py and add/modify the settings you need.
|
||||
# The parameters you add in local_settings.py will overwrite these,
|
||||
# but you can use the options and documentation in this file to find out what can be done.
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
|
||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
||||
is_public=$(ynh_app_setting_get --app="$app" --key=is_public)
|
||||
|
@ -32,7 +32,7 @@ is_public=$(ynh_app_setting_get --app="$app" --key=is_public)
|
|||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --time --weight=1
|
||||
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=40
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
|
@ -67,7 +67,7 @@ fi
|
|||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping systemd services..." --time --weight=1
|
||||
ynh_script_progression --message="Stopping systemd services..."
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="stop"
|
||||
ynh_systemd_action --service_name="$app-celery" --action="stop"
|
||||
|
@ -77,7 +77,7 @@ ynh_systemd_action --service_name="$app-celery" --action="stop"
|
|||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating nginx web server configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Updating nginx web server configuration..."
|
||||
|
||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||
|
||||
|
@ -108,7 +108,7 @@ fi
|
|||
#=================================================
|
||||
# MODIFY SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Modify weblate's config file..." --time --weight=1
|
||||
ynh_script_progression --message="Modify weblate's config file..."
|
||||
|
||||
settings="$final_path/venv/lib/$weblate_pypath/site-packages/weblate/settings.py"
|
||||
ynh_backup_if_checksum_is_different --file="$settings"
|
||||
|
@ -152,7 +152,7 @@ ynh_store_file_checksum --file="$finaluwsgiini"
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting systemd services..." --time --weight=1
|
||||
ynh_script_progression --message="Starting systemd services..." --weight=5
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="start"
|
||||
ynh_systemd_action --service_name="$app-celery" --action="start"
|
||||
|
@ -160,7 +160,7 @@ ynh_systemd_action --service_name="$app-celery" --action="start"
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -168,4 +168,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --time --last
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||
|
|
|
@ -32,7 +32,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..." --time --weight=1
|
||||
ynh_script_progression --message="Validating installation parameters..."
|
||||
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
@ -45,7 +45,7 @@ mkdir -p "$final_path"
|
|||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..." --time --weight=1
|
||||
ynh_script_progression --message="Storing installation settings..."
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=domain --value="$domain"
|
||||
ynh_app_setting_set --app="$app" --key=path --value="$path_url"
|
||||
|
@ -60,14 +60,14 @@ ynh_app_setting_set --app="$app" --key=github_token --value="$github_token"
|
|||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --time --weight=1
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=40
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
|
||||
|
||||
#=================================================
|
||||
# CREATE A PostgreSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a PostgreSQL database..." --time --weight=1
|
||||
ynh_script_progression --message="Creating a PostgreSQL database..."
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name="$app")
|
||||
db_user=$db_name
|
||||
|
@ -81,7 +81,7 @@ ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name"
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring nginx web server..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -89,7 +89,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring system user..."
|
||||
|
||||
# Hub needs a home directory with a config file
|
||||
ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell
|
||||
|
@ -97,7 +97,7 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell
|
|||
#=================================================
|
||||
# CONFIGURE HUB
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configure hub..." --time --weight=1
|
||||
ynh_script_progression --message="Configure hub..."
|
||||
|
||||
mkdir "$final_path/.config/"
|
||||
cp ../conf/hub_config "$final_path/.config/hub"
|
||||
|
@ -113,7 +113,7 @@ EOF
|
|||
#=================================================
|
||||
# PIP INSTALLATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Install weblate using PIP..." --time --weight=1
|
||||
ynh_script_progression --message="Install weblate using PIP..." --weight=80
|
||||
|
||||
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name
|
||||
|
||||
|
@ -139,7 +139,7 @@ chown -R "$app": "$final_path"
|
|||
# https://docs.weblate.org/en/latest/admin/install.html#installation
|
||||
# TODO: use --extra-search-dir=/path/to/dists
|
||||
#=================================================
|
||||
ynh_script_progression --message="Create weblate configuration file..." --time --weight=1
|
||||
ynh_script_progression --message="Create weblate configuration file..."
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd)
|
||||
admin_mail=$(ynh_user_get_info --username="$admin" --key=mail)
|
||||
|
@ -173,7 +173,7 @@ ln -sf "$final_path/local_settings.py" "$final_path/venv/lib/$weblate_pypath/sit
|
|||
# SPECIFIC SETUP Filling up the database
|
||||
# https://docs.weblate.org/en/latest/admin/install.html#filling-up-the-database
|
||||
#==========================================
|
||||
ynh_script_progression --message="Filling up the database..." --time --weight=1
|
||||
ynh_script_progression --message="Filling up the database..." --weight=10
|
||||
|
||||
(
|
||||
set +o nounset
|
||||
|
@ -204,7 +204,7 @@ ynh_store_file_checksum --file="$settings"
|
|||
#=================================================
|
||||
# SPECIFIC SETUP UWSGI
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configure uwsgi..." --time --weight=1
|
||||
ynh_script_progression --message="Configure uwsgi..."
|
||||
|
||||
|
||||
finaluwsgiini="/etc/uwsgi/apps-available/$app.ini"
|
||||
|
@ -220,14 +220,14 @@ ynh_store_file_checksum --file="$finaluwsgiini"
|
|||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
ynh_add_systemd_config --service="$app" --template="weblate.service"
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE CELERY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configure celery..." --time --weight=1
|
||||
ynh_script_progression --message="Configure celery..."
|
||||
|
||||
celeryconf="$final_path/celery-weblate"
|
||||
cp ../conf/celery-weblate "$celeryconf"
|
||||
|
@ -252,7 +252,7 @@ chown -R "$app": "$final_path/avatar-cache"
|
|||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring log rotation..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring log rotation..."
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate --non-append
|
||||
|
@ -260,7 +260,7 @@ ynh_use_logrotate --non-append
|
|||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add "$app" --log "/var/log/$app/weblate.log"
|
||||
yunohost service add "$app-celery" --log "/var/log/$app/weblate-celery-w1.log"
|
||||
|
@ -268,7 +268,7 @@ yunohost service add "$app-celery" --log "/var/log/$app/weblate-celery-w1.log"
|
|||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring SSOwat..."
|
||||
|
||||
# Make app public if necessary
|
||||
if [ "$is_public" -eq 1 ]
|
||||
|
@ -280,7 +280,7 @@ fi
|
|||
#=================================================
|
||||
# Start weblate
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting weblate's services..." --time --weight=1
|
||||
ynh_script_progression --message="Starting weblate's services..." --weight=5
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="start"
|
||||
ynh_systemd_action --service_name="$app-celery" --action="start"
|
||||
|
@ -288,7 +288,7 @@ ynh_systemd_action --service_name="$app-celery" --action="start"
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
|
||||
ynh_systemd_action --service_name="nginx" --action="reload"
|
||||
|
||||
|
@ -303,4 +303,4 @@ If you facing an issue or want to improve this app, please open a new issue in t
|
|||
|
||||
ynh_send_readme_to_admin "$message" "$admin"
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed" --time --last
|
||||
ynh_script_progression --message="Installation of $app completed" --last
|
||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
|
@ -29,21 +29,21 @@ final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
|||
# Remove a service from the admin panel, added by `yunohost service add`
|
||||
if yunohost service status "$app" >/dev/null 2>&1
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service integration..." --time --weight=1
|
||||
ynh_script_progression --message="Removing $app service integration..."
|
||||
yunohost service remove "$app"
|
||||
fi
|
||||
|
||||
# Remove a service from the admin panel, added by `yunohost service add`
|
||||
if yunohost service status "$app-celery" >/dev/null 2>&1
|
||||
then
|
||||
ynh_script_progression --message="Removing $app-celery service integration..." --time --weight=1
|
||||
ynh_script_progression --message="Removing $app-celery service integration..."
|
||||
yunohost service remove "$app-celery"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STOP WEBLATE'S SERVICES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping and removing systemd services..." --time --weight=1
|
||||
ynh_script_progression --message="Stopping and removing systemd services..." --weight=5
|
||||
|
||||
ynh_remove_systemd_config --service="$app"
|
||||
ynh_remove_systemd_config --service="$app-celery"
|
||||
|
@ -51,7 +51,7 @@ ynh_remove_systemd_config --service="$app-celery"
|
|||
#=================================================
|
||||
# REMOVE THE PostgreSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the PostgreSQL database..." --time --weight=1
|
||||
ynh_script_progression --message="Removing the PostgreSQL database..."
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
|
@ -65,17 +65,17 @@ ynh_redis_remove_db
|
|||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..." --time --weight=1
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=10
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
finaluwsgiini="/etc/uwsgi/apps-available/$app.ini"
|
||||
ynh_secure_remove --file="$finaluwsgiini"
|
||||
ynh_remove_app_dependencies
|
||||
ynh_exec_warn_less ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing app main directory..." --time --weight=1
|
||||
ynh_script_progression --message="Removing app main directory..."
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
@ -83,7 +83,7 @@ ynh_secure_remove --file="$final_path"
|
|||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Removing nginx web server configuration..."
|
||||
|
||||
# Remove the dedicated nginx config
|
||||
ynh_remove_nginx_config
|
||||
|
@ -91,7 +91,7 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
# REMOVE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Removing logrotate configuration..."
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
@ -109,7 +109,7 @@ ynh_secure_remove --file="/var/run/$app-celery"
|
|||
#=================================================
|
||||
# REMOVE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1
|
||||
ynh_script_progression --message="Removing the dedicated system user..."
|
||||
|
||||
# Delete a system user
|
||||
ynh_system_user_delete --username="$app"
|
||||
|
@ -117,4 +117,4 @@ ynh_system_user_delete --username="$app"
|
|||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removal of $app completed" --time --last
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
|
|
|
@ -18,7 +18,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading settings..." --time --weight=1
|
||||
ynh_script_progression --message="Loading settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -32,7 +32,7 @@ db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd)
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --time --weight=1
|
||||
ynh_script_progression --message="Validating restoration parameters..."
|
||||
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
|
@ -50,7 +50,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring the app main directory..."
|
||||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
|
@ -60,7 +60,7 @@ ln -sf "$final_path/local_settings.py" "$final_path/venv/lib/$weblate_pypath/sit
|
|||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1
|
||||
ynh_script_progression --message="Recreating the dedicated system user..."
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path" --use_shell
|
||||
|
@ -80,14 +80,14 @@ chown -R "$app": "$final_path/avatar-cache"
|
|||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=40
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PostgreSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the PostgreSQL database..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=5
|
||||
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd"
|
||||
|
@ -97,7 +97,7 @@ ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./d
|
|||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service
|
||||
|
@ -107,14 +107,14 @@ systemctl enable "$app-celery"
|
|||
#=================================================
|
||||
# RESTORE UWSGI
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring uwsgi configurations..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring uwsgi configurations..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/uwsgi/apps-available/$app.ini"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add "$app" --log "/var/log/$app/weblate.log"
|
||||
yunohost service add "$app-celery" --log "/var/log/$app/weblate-celery-w1.log"
|
||||
|
@ -131,7 +131,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|||
#=================================================
|
||||
# START WEBLATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=5
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="start"
|
||||
ynh_systemd_action --service_name="$app-celery" --action="start"
|
||||
|
@ -139,7 +139,7 @@ ynh_systemd_action --service_name="$app-celery" --action="start"
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
|
||||
ynh_systemd_action --service_name="nginx" --action="reload"
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -32,7 +32,7 @@ redis_db=$(ynh_app_setting_get --app="$app" --key=redis_db)
|
|||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=40
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
|
@ -46,7 +46,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
|
||||
# Fix is_public as a boolean value
|
||||
if [ "$is_public" = "Yes" ]; then
|
||||
|
@ -83,7 +83,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
|||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping systemd services..." --time --weight=1
|
||||
ynh_script_progression --message="Stopping systemd services..." --weight=5
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="stop"
|
||||
ynh_systemd_action --service_name="$app-celery" --action="stop"
|
||||
|
@ -91,7 +91,7 @@ ynh_systemd_action --service_name="$app-celery" --action="stop"
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -101,7 +101,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# Update dependencies
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --time --weight=1
|
||||
ynh_script_progression --message="Upgrading dependencies..."
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
|
||||
|
||||
|
@ -116,7 +116,7 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell
|
|||
#=================================================
|
||||
# CONFIGURE HUB
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configure hub..." --time --weight=1
|
||||
ynh_script_progression --message="Configure hub..."
|
||||
|
||||
mkdir -p "$final_path/.config/"
|
||||
cp ../conf/hub_config "$final_path/.config/hub"
|
||||
|
@ -130,7 +130,7 @@ EOF
|
|||
#=================================================
|
||||
# SPECIFIC SETUP UWSGI
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configure uwsgi..." --time --weight=1
|
||||
ynh_script_progression --message="Configure uwsgi..."
|
||||
|
||||
finaluwsgiini="/etc/uwsgi/apps-available/$app.ini"
|
||||
ynh_backup_if_checksum_is_different --file="$finaluwsgiini"
|
||||
|
@ -146,14 +146,14 @@ ynh_store_file_checksum --file="$finaluwsgiini"
|
|||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
ynh_add_systemd_config --service="$app" --template="weblate.service"
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE CELERY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configure celery..." --time --weight=1
|
||||
ynh_script_progression --message="Configure celery..."
|
||||
|
||||
celeryconf="$final_path/celery-weblate"
|
||||
cp ../conf/celery-weblate "$celeryconf"
|
||||
|
@ -173,7 +173,7 @@ upgrade() {
|
|||
#=================================================
|
||||
# PIP INSTALLATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Install weblate using PIP..." --time --weight=1
|
||||
ynh_script_progression --message="Install weblate using PIP..." --weight=15
|
||||
|
||||
ynh_systemd_action --service_name="$app-celery" --action="stop"
|
||||
|
||||
|
@ -230,7 +230,7 @@ upgrade() {
|
|||
#=================================================
|
||||
# MIGRATE WEBLATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Run migration scripts..." --time --weight=1
|
||||
ynh_script_progression --message="Run migration scripts..." --weight=10
|
||||
|
||||
ynh_systemd_action --service_name="$app-celery" --action="start"
|
||||
|
||||
|
@ -275,7 +275,7 @@ upgrade $weblate_version "../conf/settings.py"
|
|||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Upgrading logrotate configuration..."
|
||||
|
||||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_use_logrotate --non-append
|
||||
|
@ -283,7 +283,7 @@ ynh_use_logrotate --non-append
|
|||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add "$app" --log "/var/log/$app/weblate.log"
|
||||
yunohost service add "$app-celery" --log "/var/log/$app/weblate-celery-w1.log"
|
||||
|
@ -303,7 +303,7 @@ chown -R "$app": "$final_path/avatar-cache"
|
|||
#=================================================
|
||||
# START SYSTEMD SERVICES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting systemd services..." --time --weight=1
|
||||
ynh_script_progression --message="Starting systemd services..." --weight=5
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="start"
|
||||
ynh_systemd_action --service_name="$app-celery" --action="start"
|
||||
|
@ -311,7 +311,7 @@ ynh_systemd_action --service_name="$app-celery" --action="start"
|
|||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
||||
|
||||
# Make app public if necessary
|
||||
if [ "$is_public" -eq 1 ]
|
||||
|
@ -323,7 +323,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -331,4 +331,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --time --last
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
Loading…
Reference in a new issue