mirror of
https://github.com/YunoHost-Apps/libremdb_ynh.git
synced 2024-09-03 19:36:22 +02:00
cleaning
This commit is contained in:
parent
b72a939fc9
commit
06779c3dfc
7 changed files with 11 additions and 53 deletions
|
@ -6,7 +6,7 @@ After=network.target
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
Environment="PATH=__ENV_PATH__"
|
||||
Environment="__YNH_NODE_LOAD_PATH__"
|
||||
Environment="NODE_ENV=production"
|
||||
WorkingDirectory=__INSTALL_DIR__/
|
||||
ExecStart=/usr/bin/yarn start -p __PORT__
|
||||
|
|
|
@ -19,8 +19,11 @@ code = "https://github.com/zyachel/libremdb"
|
|||
yunohost = ">= 11.2"
|
||||
architectures = "all"
|
||||
multi_instance = true
|
||||
|
||||
ldap = false
|
||||
|
||||
sso = false
|
||||
|
||||
disk = "50M"
|
||||
ram.build = "50M"
|
||||
ram.runtime = "50M"
|
||||
|
|
|
@ -32,7 +32,7 @@ ynh_script_progression --message="Changing app configuration file..." --weight=1
|
|||
|
||||
domain="$old_domain"
|
||||
|
||||
ynh_add_config --template="../conf/.env.local.example" --destination="$install_dir/.env.local"
|
||||
ynh_add_config --template=".env.local.example" --destination="$install_dir/.env.local"
|
||||
|
||||
chmod 400 "$install_dir/.env.local"
|
||||
chown $app:$app "$install_dir/.env.local"
|
||||
|
|
|
@ -48,16 +48,15 @@ ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/.env.local.example" --destination="$install_dir/.env.local"
|
||||
ynh_add_config --template=".env.local.example" --destination="$install_dir/.env.local"
|
||||
|
||||
chmod 400 "$install_dir/.env.local"
|
||||
chown $app:$app "$install_dir/.env.local"
|
||||
|
||||
|
||||
#=================================================
|
||||
# INSTALL LIBREMDB
|
||||
#=================================================
|
||||
ynh_script_progression --message="Building the app..." --weight=20
|
||||
ynh_script_progression --message="Building $app..." --weight=20
|
||||
|
||||
pushd $install_dir
|
||||
ynh_use_nodejs
|
||||
|
@ -72,15 +71,9 @@ popd
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||
|
||||
env_path="$PATH"
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="IMDb front-end" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -22,34 +22,14 @@ then
|
|||
yunohost service remove $app
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
||||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE REDIS DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the redis database..."
|
||||
|
||||
ynh_redis_remove_db "$redis_db"
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||
|
||||
# Remove NodeJS
|
||||
ynh_remove_nodejs
|
||||
|
||||
|
|
|
@ -33,39 +33,22 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
|||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="IMDb front-end" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -72,7 +72,7 @@ chown -R $app:www-data "$install_dir"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/.env.local.example" --destination="$install_dir/.env.local"
|
||||
ynh_add_config --template=".env.local.example" --destination="$install_dir/.env.local"
|
||||
|
||||
chmod 400 "$install_dir/.env.local"
|
||||
chown $app:$app "$install_dir/.env.local"
|
||||
|
@ -90,7 +90,6 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
||||
|
||||
env_path="$PATH"
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
|
Loading…
Reference in a new issue