1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

run source in subshell and move pip installation after defining settings

This commit is contained in:
Jean-Baptiste Holcroft 2017-09-14 17:40:26 +02:00
parent 4ee0fd1dff
commit 5d2d50aa78

View file

@ -107,14 +107,6 @@ ynh_add_nginx_config
# Create a system user # Create a system user
ynh_system_user_create $app ynh_system_user_create $app
#=================================================
# PIP INSTALLATION
#=================================================
virtualenv ${final_path}/venv
source ${final_path}/venv/bin/activate
${final_path}/venv/bin/pip install Weblate==2.16
${final_path}/venv/bin/pip install pytz python-bidi PyYaML Babel pyuca pylibravatar pydns
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -160,6 +152,16 @@ ynh_replace_string "__ADMINMAIL__" "$admin_mail" $final_path/weblate/settings.py
ynh_replace_string "__DOMAIN__" "$domain" $final_path/weblate/settings.py ynh_replace_string "__DOMAIN__" "$domain" $final_path/weblate/settings.py
ynh_replace_string "__KEY__" "$key" $final_path/weblate/settings.py ynh_replace_string "__KEY__" "$key" $final_path/weblate/settings.py
#=================================================
# PIP INSTALLATION
#=================================================
virtualenv ${final_path}/venv
#run source in a 'sub shell'
(
source ${final_path}/venv/bin/activate
${final_path}/venv/bin/pip install Weblate==2.16
${final_path}/venv/bin/pip install pytz python-bidi PyYaML Babel pyuca pylibravatar pydns
)
#================================================= #=================================================
# SPECIFIC SETUP Filling up the database # SPECIFIC SETUP Filling up the database
@ -167,9 +169,12 @@ ynh_replace_string "__KEY__" "$key" $final_path/weblate/settings.py
#========================================== #==========================================
echo "SPECIFIC SETUP Filling up the database" echo "SPECIFIC SETUP Filling up the database"
# set up database # set up database
source ${final_path}/venv/bin/activate && weblate migrate --noinput --settings weblate.settings (
source ${final_path}/venv/bin/activate
weblate migrate --noinput --settings weblate.settings
# generate static files # generate static files
source ${final_path}/venv/bin/activate && weblate collectstatic --noinput --settings weblate.settings weblate collectstatic --noinput --settings weblate.settings
)
#================================================= #=================================================
# SETUP CRON # SETUP CRON