mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
Merge pull request #24 from YunoHost-Apps/refactor-virtualenv-for-harmonization
update to 0.7.18 + Refactor virtualenv for harmonization
This commit is contained in:
commit
430e747c0e
9 changed files with 38 additions and 45 deletions
|
@ -20,7 +20,7 @@ FitTrackee allows you to track your outdoor activities (workouts) from gpx files
|
|||
No mobile app has been developed yet, but several existing mobile apps can store workouts data locally and export them into a gpx file.
|
||||
|
||||
|
||||
**Shipped version:** 0.7.17~ynh1
|
||||
**Shipped version:** 0.7.18~ynh1
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
|
|||
FitTrackee vous permet de suivre vos activités de plein air (séances d'entraînement) à partir de fichiers gpx et de conserver vos données sur votre propre serveur.
|
||||
Aucune application mobile n'a encore été développée, mais plusieurs applications mobiles existantes peuvent stocker localement les données des séances d'entraînement et les exporter dans un fichier gpx.
|
||||
|
||||
**Version incluse :** 0.7.17~ynh1
|
||||
**Version incluse :** 0.7.18~ynh1
|
||||
|
||||
## Captures d’écran
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ Environment="STATICMAP_SUBDOMAINS="
|
|||
Environment="MAP_ATTRIBUTION="
|
||||
Environment="WEATHER_API_KEY="
|
||||
WorkingDirectory=__INSTALL_DIR__/
|
||||
ExecStart=__INSTALL_DIR__/.venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/gunicorn.log
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/gunicorn.log
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ Environment="EMAIL_URL="
|
|||
Environment="SENDER_EMAIL="
|
||||
Environment="REDIS_URL="
|
||||
WorkingDirectory=__INSTALL_DIR__/
|
||||
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
|
||||
ExecStart=__INSTALL_DIR__/venv/bin/flask worker --processes 2
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ name = "FitTrackee"
|
|||
description.en = "Self-hosted outdoor activity tracker 🚴"
|
||||
description.fr = "Traqueur d’activités extérieures auto-hébergé 🚴"
|
||||
|
||||
version = "0.7.17~ynh1"
|
||||
version = "0.7.18~ynh1"
|
||||
|
||||
maintainers = ["Thovi98"]
|
||||
|
||||
|
@ -77,7 +77,7 @@ ram.runtime = "50M"
|
|||
main.default = 5000
|
||||
|
||||
[resources.apt]
|
||||
packages = "postgresql, postgresql-contrib, python3-venv libopenjp2-7"
|
||||
packages = "postgresql, postgresql-contrib, python3, python3-venv, libopenjp2-7"
|
||||
|
||||
[resources.database]
|
||||
type = "postgresql"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
fittrackee_version="0.7.17"
|
||||
fittrackee_version="0.7.18"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -23,16 +23,6 @@ touch /var/log/$app/${app}_workers.log
|
|||
touch /var/log/$app/gunicorn.log
|
||||
chown -R $app:www-data /var/log/$app/
|
||||
|
||||
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=23
|
||||
|
||||
ynh_exec_warn_less python3 -m pip install pipenv
|
||||
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -49,29 +39,32 @@ ynh_script_progression --message="Setting up source files..." --weight=64
|
|||
ynh_add_config --template="../conf/.env.production" --destination="$install_dir/.env"
|
||||
chmod 600 $install_dir/.env
|
||||
|
||||
|
||||
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
|
||||
set -a; source "$install_dir/.env"; set +a
|
||||
|
||||
pushd $install_dir
|
||||
mkdir -p .venv
|
||||
PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install fittrackee==$fittrackee_version python-dotenv
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# INSTALL PYTHON DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Python dependencies..." --weight=3
|
||||
|
||||
pushd $install_dir
|
||||
python3 -m venv $install_dir/venv
|
||||
source $install_dir/venv/bin/activate
|
||||
ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml pyyaml
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# INITIALIZE DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Initializing database..." --weight=1
|
||||
|
||||
ynh_exec_warn_less $install_dir/.venv/bin/ftcli db upgrade
|
||||
ynh_exec_warn_less $install_dir/venv/bin/ftcli db upgrade
|
||||
|
||||
ynh_exec_warn_less $install_dir/.venv/bin/ftcli users create $admin --email $admin_mail --password $password
|
||||
ynh_exec_warn_less $install_dir/venv/bin/ftcli users create $admin --email $admin_mail --password $password
|
||||
|
||||
ynh_exec_warn_less $install_dir/.venv/bin/ftcli users update $admin --set-admin true
|
||||
ynh_exec_warn_less $install_dir/venv/bin/ftcli users update $admin --set-admin true
|
||||
|
||||
#=================================================
|
||||
# System Configuration
|
||||
|
|
|
@ -38,27 +38,12 @@ ynh_systemd_action --action="stop" --service_name="${app}_workers"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=23
|
||||
|
||||
ynh_exec_warn_less python3 -m pip install pipenv
|
||||
|
||||
|
||||
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
|
||||
mkdir -p "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app: "$install_dir"
|
||||
|
||||
pushd $install_dir
|
||||
mkdir -p .venv
|
||||
PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install fittrackee==$fittrackee_version python-dotenv
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES
|
||||
# CONFIGURE THE INSTALL SCRIPT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing service script..." --weight=1
|
||||
|
||||
|
@ -68,12 +53,26 @@ chown $app: "$install_dir/.env"
|
|||
|
||||
set -a; source "$install_dir/.env"; set +a
|
||||
|
||||
#=================================================
|
||||
# INSTALL PYTHON DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Python dependencies..." --weight=3
|
||||
|
||||
ynh_secure_remove $install_dir/.venv
|
||||
|
||||
pushd $install_dir
|
||||
python3 -m venv $install_dir/venv
|
||||
source $install_dir/venv/bin/activate
|
||||
ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml pyyaml
|
||||
popd
|
||||
|
||||
|
||||
#=================================================
|
||||
# Update DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading database..." --weight=1
|
||||
|
||||
ynh_exec_warn_less $install_dir/.venv/bin/ftcli db upgrade
|
||||
ynh_exec_warn_less $install_dir/venv/bin/ftcli db upgrade
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -16,4 +16,5 @@ test_format = 1.0
|
|||
# Commits to test upgrade from
|
||||
# -------------------------------
|
||||
|
||||
test_upgrade_from.852bf0d.name = "Upgrade from 0.7.14"
|
||||
test_upgrade_from.852bf0d.name = "0.7.14"
|
||||
test_upgrade_from.0b20803.name = "0.7.17"
|
||||
|
|
Loading…
Reference in a new issue