1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/libreerp_ynh.git synced 2024-09-03 19:36:13 +02:00

Merge pull request #36 from YunoHost-Apps/upgrade

Upgrade to 16.0~ynh1
This commit is contained in:
yalh76 2022-10-21 19:53:34 +02:00 committed by GitHub
commit 6bc5656704
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 127 additions and 96 deletions

View file

@ -22,7 +22,7 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P
LibreERP Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
**Shipped version:** 15.0~ynh1
**Shipped version:** 16.0~ynh1
**Demo:** https://www.odoo.com/trial
## Disclaimers / important information
@ -36,7 +36,7 @@ https://example.com/erp/ will NOT work
To connect on your LibreERP
-----------
- Go on https://YOURDOMAIN/web
- Use your master password
- Login as "admin" with the master password you provied during installation
About licences
-----------

View file

@ -22,7 +22,7 @@ The main LibreERP Apps include an Open Source CRM, Website Builder, eCommerce, P
LibreERP Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
**Version incluse :** 15.0~ynh1
**Version incluse :** 16.0~ynh1
**Démo :** https://www.odoo.com/trial
## Avertissements / informations importantes
@ -36,7 +36,7 @@ https://example.com/erp/ will NOT work
To connect on your LibreERP
-----------
- Go on https://YOURDOMAIN/web
- Use your master password
- Login as "admin" with the master password you provied during installation
About licences
-----------

View file

@ -7,7 +7,7 @@
lang="en_US"
tz="Etc/GMT"
admin="john"
password="1Strong-Password"
admin_password="1Strong-Password"
; Checks
pkg_linter=1
setup_sub_dir=0
@ -31,7 +31,31 @@
lang="en_US"
tz="Etc/GMT"
admin="john"
password="1Strong-Password"
admin_password="1Strong-Password"
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=1
setup_nourl=0
setup_private=0
setup_public=1
upgrade=1
# 15.0~ynh1
upgrade=1 from_commit=c82770776ccf5ea14a1b47f0ee6a113858e749e6
backup_restore=1
multi_instance=1
port_already_use=0
change_url=0
;; Test complet sans multisite v16
auto_remove=1
; Manifest
domain="domain.tld"
version="16"
oca=0
lang="en_US"
tz="Etc/GMT"
admin="john"
admin_password="1Strong-Password"
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/odoo/odoo/archive/04e37773d1bf9b885be674d85bdf0ec069926958.tar.gz
SOURCE_SUM=023afbaada2182cd6e54c0717915f7585e6899e2c23ad54d9f2372e88bcf35ec
SOURCE_URL=https://github.com/odoo/odoo/archive/c53081f10befd4f1c98e46a450ed3bc71a6246ed.tar.gz
SOURCE_SUM=e2569f947d83ee549304a3112cf5dda3ff4ef7affca8e5e6119b1305ccac1bae
SOURCE_FILENAME=odoo-12.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/odoo/odoo/archive/5a8690b35a2fa9c5ed81d858ac0d170beaabaaf9.tar.gz
SOURCE_SUM=b52829b5f01f39d8e9bd6977eb1b9c23053e92c7574ec26e5b3d218522fccf3a
SOURCE_URL=https://github.com/odoo/odoo/archive/8ede8a758a92c4b61fe48d820464783e21ee7847.tar.gz
SOURCE_SUM=9bd03884cdfe644652a09f86cec652d69c11538d0e0ed620740c25f49099a734
SOURCE_FILENAME=odoo-14.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/odoo/odoo/archive/2354fade236b2853835761a129ef2c4ea450d728.tar.gz
SOURCE_SUM=566c7df9d4967fdca65060f78dc0202febc72ef2691ef72ae256892fc838ea48
SOURCE_URL=https://github.com/odoo/odoo/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz
SOURCE_SUM=93e12c7574e73403d4da456cf612fd5542d961e302fdf9c3a87cdeca9146184d
SOURCE_FILENAME=odoo-15.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

5
conf/16.src Normal file
View file

@ -0,0 +1,5 @@
SOURCE_URL=https://github.com/odoo/odoo/archive/f5ffcf7feec5526a483f8ddd240648c084351008.tar.gz
SOURCE_SUM=f9d257058bb7075c2f0b75022fb2ec363ddeed27e3f1a55110ed08dfbee2227b
SOURCE_FILENAME=odoo-16.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/OCA/OCB/archive/f38c99acbea6e1ab42deddb468b9710cabccfbdf.tar.gz
SOURCE_SUM=55cb5e87022a87cf13c9d74bf094da2c098cf64fb8fdacbf42fadeea2479daa0
SOURCE_FILENAME=odoo-12.tar.gz
SOURCE_URL=https://github.com/OCA/OCB/archive/daa274eb48324d563e1096e334a5a73034be71dc.tar.gz
SOURCE_SUM=73bd925d3bdc402248548f92908a07e8475b6703d063609ba7f0729060c59aac
SOURCE_FILENAME=oca-12.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/OCA/OCB/archive/e1e9e7420a5b5b32d5359ffed19e718080764ddd.tar.gz
SOURCE_SUM=acfbf7a2428a51962d1d1a084c5a959a392c522b8aad7b98d7abac75c84259d9
SOURCE_FILENAME=odoo-14.tar.gz
SOURCE_URL=https://github.com/OCA/OCB/archive/890a6aa943aafff149924b1aca2517a95a1b352f.tar.gz
SOURCE_SUM=41decd11b20d8f99329c413faec9abd1e5ee75076e5f47a33ab806483f51926c
SOURCE_FILENAME=oca-14.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/OCA/OCB/archive/2354fade236b2853835761a129ef2c4ea450d728.tar.gz
SOURCE_SUM=8bab7886de520295a2db4ab0895b0a3b556a2cd7d77e903347f99762310b636f
SOURCE_FILENAME=odoo-15.tar.gz
SOURCE_URL=https://github.com/OCA/OCB/archive/1ab48bd4c89f21691b34f349338405fcbb85dea4.tar.gz
SOURCE_SUM=23b8902b6fc22e4ce36f6dcc7178257235663e9911b61b70b70aeca0fdb36331
SOURCE_FILENAME=oca-15.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

5
conf/oca-16.src Normal file
View file

@ -0,0 +1,5 @@
SOURCE_URL=https://github.com/OCA/OCB/archive/f5ffcf7feec5526a483f8ddd240648c084351008.tar.gz
SOURCE_SUM=bf972341c69e5f720162f3d9fa8a93d08ddb9f018c8aea5c4f5d7915c4275c5c
SOURCE_FILENAME=oca-16.tar.gz
SOURCE_FORMAT=tar.gz
SOURCE_SUM_PRG=sha256sum

View file

@ -7,7 +7,7 @@ https://example.com/erp/ will NOT work
To connect on your LibreERP
-----------
- Go on https://YOURDOMAIN/web
- Use your master password
- Login as "admin" with the master password you provied during installation
About licences
-----------

View file

@ -6,7 +6,7 @@
"en": "Suite of business apps (ERP: CRM, Accounting, Point of Sale, HR, Purchases...).",
"fr": "Une collection d'apps de gestion d'entreprise (ERP : CRM, Comptabilité, Point de Vente, RH, Achats, ...)."
},
"version": "15.0~ynh1",
"version": "16.0~ynh1",
"url": "https://odoo.com",
"upstream": {
"license": "LGPL-3.0-only",
@ -16,7 +16,7 @@
"userdoc": "https://www.odoo.com/documentation/15.0/applications.html",
"code": "https://github.com/odoo/odoo"
},
"license": "LGPL-3.0,AGPL-3.0",
"license": "LGPL-3.0-only",
"maintainer": {
"name": "ljf",
"email": "ljf+libreerp_ynh@reflexlibre.net"
@ -44,8 +44,8 @@
"en": "Choose the version you want",
"fr": "Choisissez la version désirée"
},
"choices": ["11", "12", "14", "15"],
"default": "15"
"choices": ["11", "12", "14", "15", "16"],
"default": "16"
},
{
"name": "oca",

View file

@ -33,8 +33,6 @@ function debranding() {
sed -i 's/<a[^>]*>Support<\/a>//g' $final_path/$appname/addons/web/static/src/xml/base.xml
fi
cp ../conf/logo_type.png $python_app/addons/base/static/img/logo_white.png
cp ../conf/favicon.ico $final_path/$appname/addons/web/static/src/img/favicon.ico
}
function setup_files() {

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
ynh_print_info --message="Loading settings..."
app=$YNH_APP_INSTANCE_NAME

View file

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -40,7 +40,7 @@ export preinstall=0
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..."
ynh_script_progression --message="Validating installation parameters..." --weight=1
export final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
@ -59,7 +59,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..."
ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=app_version --value=$app_version
@ -73,7 +73,7 @@ ynh_app_setting_set --app=$app --key=conf_file --value=$conf_file
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Finding an available port..."
ynh_script_progression --message="Finding an available port..." --weight=1
# Find an available port
port=$(ynh_find_port --port=8069)
@ -86,14 +86,14 @@ ynh_app_setting_set --app=$app --key=port_chat --value=$port_chat
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..."
ynh_script_progression --message="Installing dependencies..." --weight=1
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
@ -101,7 +101,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# CREATE A POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Creating a PostgreSQL database..."
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1
export db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
@ -120,7 +120,7 @@ ynh_psql_execute_as_root --sql="update pg_database set encoding = pg_char_to_enc
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..."
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
@ -129,7 +129,7 @@ setup_files
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
@ -143,14 +143,14 @@ ynh_add_nginx_config
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
:
else
ynh_script_progression --message="Adding swap..."
ynh_script_progression --message="Adding swap..." --weight=1
ynh_add_swap --size=$swap_needed
fi
#=================================================
# BUILD APP
#=================================================
ynh_script_progression --message="Building $app..."
ynh_script_progression --message="Building app..." --weight=1
if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then
# The debian package has a bug so we deploy a more recent version
@ -164,8 +164,8 @@ if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then
fi
fi
pushd $final_path
RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable --profile=minimal'
PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
if grep "python3" $final_path/$appname/$FORKNAME-bin ; then
python3 -m venv venv
venv/bin/pip3 install --upgrade pip
@ -184,7 +184,7 @@ popd
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..."
ynh_script_progression --message="Configuring a systemd service..." --weight=1
# Create a dedicated systemd config
ynh_add_systemd_config
@ -192,7 +192,7 @@ ynh_add_systemd_config
#=================================================
# SETUP DATABASE
#=================================================
ynh_script_progression --message="Setuping the database..."
ynh_script_progression --message="Setuping the database..." --weight=1
setup_database
@ -201,14 +201,14 @@ setup_database
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log="/var/log/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log"
@ -216,7 +216,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..."
ynh_script_progression --message="Configuring permissions..." --weight=1
ynh_permission_update --permission="main" --add="visitors"
@ -226,7 +226,7 @@ ynh_permission_create --permission="admin" --url="/web/database/manager" --allow
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
@ -234,4 +234,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed"
ynh_script_progression --message="Installation of $app completed" --last

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
ynh_script_progression --message="Loading settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
@ -31,14 +31,14 @@ conf_file=$(ynh_app_setting_get --app=$app --key=conf_file)
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..."
ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config
@ -46,7 +46,7 @@ ynh_remove_systemd_config
#=================================================
# REMOVE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Removing the PostgreSQL database..."
ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1
# Remove a database if it exists, along with the associated user
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
@ -54,7 +54,7 @@ ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..."
ynh_script_progression --message="Removing app main directory..." --weight=1
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -62,7 +62,7 @@ ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..."
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config
@ -70,7 +70,7 @@ ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
@ -80,7 +80,7 @@ ynh_remove_app_dependencies
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
ynh_script_progression --message="Removing various files..." --weight=1
# Remove a directory securely
ynh_secure_remove --file="/etc/$app"
@ -95,7 +95,7 @@ ynh_secure_remove --file="/var/log/$app.log"
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
:
else
ynh_script_progression --message="Removing swap..."
ynh_script_progression --message="Removing swap..." --weight=1
ynh_del_swap
fi
@ -104,7 +104,7 @@ fi
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..."
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
# Delete a system user
ynh_system_user_delete --username=$app
@ -113,4 +113,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed"
ynh_script_progression --message="Removal of $app completed" --last

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -23,7 +23,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
ynh_script_progression --message="Loading installation settings..." --weight=1
export app=$YNH_APP_INSTANCE_NAME
@ -50,7 +50,7 @@ export preinstall=0
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
ynh_script_progression --message="Validating restoration parameters..." --weight=1
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
@ -60,7 +60,7 @@ test ! -d $final_path \
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
@ -68,7 +68,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_restore_file --origin_path="$final_path/$appname"
ynh_restore_file --origin_path="$final_path/custom-addons"
@ -83,7 +83,7 @@ chown -R $app:$app "$final_path"
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
@ -91,7 +91,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -102,14 +102,14 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
:
else
ynh_script_progression --message="Adding swap..."
ynh_script_progression --message="Adding swap..." --weight=1
ynh_add_swap --size=$swap_needed
fi
#=================================================
# BUILD APP
#=================================================
ynh_script_progression --message="Building $app..."
ynh_script_progression --message="Building app..." --weight=1
if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then
# The debian package has a bug so we deploy a more recent version
@ -123,8 +123,8 @@ if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then
fi
fi
pushd $final_path
RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable --profile=minimal'
PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
if grep "python3" $final_path/$appname/$FORKNAME-bin ; then
python3 -m venv venv
venv/bin/pip3 install --upgrade pip
@ -143,7 +143,7 @@ popd
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..."
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
# Make sure that postgresql is installed and running
ynh_psql_test_if_first_run
@ -160,7 +160,7 @@ ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./d
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..."
ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="$conf_file"
chmod 400 "$conf_file"
@ -172,7 +172,7 @@ chown $app:$app /var/log/$app.log
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..."
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
@ -180,14 +180,14 @@ systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log="/var/log/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log"
@ -196,7 +196,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
@ -204,4 +204,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app"
ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
ynh_script_progression --message="Loading settings..." --weight=1
export app=$YNH_APP_INSTANCE_NAME
@ -28,19 +28,18 @@ export preinstall=0
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
ynh_script_progression --message="Checking version..." --weight=1
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)..."
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
@ -52,14 +51,14 @@ ynh_abort_if_errors
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app.log"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
@ -76,7 +75,7 @@ fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
@ -87,7 +86,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..."
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
setup_files
@ -96,14 +95,14 @@ fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..."
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
@ -117,14 +116,14 @@ ynh_add_nginx_config
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
:
else
ynh_script_progression --message="Adding swap..."
ynh_script_progression --message="Adding swap..." --weight=1
ynh_add_swap --size=$swap_needed
fi
#=================================================
# BUILD APP
#=================================================
ynh_script_progression --message="Building $app..."
ynh_script_progression --message="Building app..." --weight=1
if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then
# The debian package has a bug so we deploy a more recent version
@ -138,8 +137,8 @@ if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then
fi
fi
pushd $final_path
RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable --profile=minimal'
PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
if grep "python3" $final_path/$appname/$FORKNAME-bin ; then
python3 -m venv venv
venv/bin/pip3 install --upgrade pip
@ -160,21 +159,21 @@ popd
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log="/var/log/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app.log"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
@ -182,4 +181,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed"
ynh_script_progression --message="Upgrade of $app completed" --last