1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tandoor_ynh.git synced 2024-09-03 20:35:56 +02:00
This commit is contained in:
Éric Gaspar 2024-07-22 12:57:33 +02:00
parent 4c6eb542d5
commit f294abb634
3 changed files with 12 additions and 13 deletions

View file

@ -16,13 +16,13 @@ _tandoor_venv_install() {
ynh_exec_as "$app" python3 -m venv --upgrade "$install_dir/venv"
venvpy="$install_dir/venv/bin/python3"
pushd "$install_dir/source"
pushd "$install_dir"
ynh_exec_as "$app" "$venvpy" -m pip install -r requirements.txt
popd
}
_tandoor_build_frontend() {
pushd "$install_dir/source/vue"
pushd "$install_dir/vue"
ynh_use_nodejs
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" yarn install
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" yarn build

View file

@ -38,7 +38,7 @@ ynh_psql_execute_as_root --sql="ALTER USER $db_name WITH SUPERUSER;"
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/source"
ynh_setup_source --dest_dir="$install_dir"
chown -R "$app:www-data" "$install_dir"
@ -54,10 +54,10 @@ chown "$app:$app" "$install_dir/.env"
version=$(ynh_app_upstream_version)
ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py"
ynh_add_config --template="version.py" --destination="$install_dir/recipes/version.py"
chmod 400 "$install_dir/source/recipes/version.py"
chown "$app:$app" "$install_dir/source/recipes/version.py"
chmod 400 "$install_dir/recipes/version.py"
chown "$app:$app" "$install_dir/recipes/version.py"
#=================================================
# SPECIFIC SETUP
@ -69,10 +69,9 @@ ynh_script_progression --message="Installing Tandoor and its python dependencies
_tandoor_venv_install
ynh_script_progression --message="Running migrations and generating static files..." --weight=2
pushd "$install_dir/source"
pushd "$install_dir"
(
source "$install_dir/.env"
ynh_exec_as "$app" "$venvpy" manage.py migrate
ynh_psql_execute_as_root --sql="ALTER USER $app WITH NOSUPERUSER;"
ynh_exec_as "$app" "$venvpy" manage.py collectstatic --no-input

View file

@ -31,7 +31,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/source" --full_replace=1 --keep="$install_dir/.env"
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="$install_dir/.env"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
@ -49,10 +49,10 @@ chown "$app:$app" "$install_dir/.env"
version=$(ynh_app_upstream_version)
ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py"
ynh_add_config --template="version.py" --destination="$install_dir/recipes/version.py"
chmod 400 "$install_dir/source/recipes/version.py"
chown "$app:$app" "$install_dir/source/recipes/version.py"
chmod 400 "$install_dir/recipes/version.py"
chown "$app:$app" "$install_dir/recipes/version.py"
#=================================================
# SPECIFIC SETUP
@ -66,7 +66,7 @@ ynh_script_progression --message="Installing Tandoor and its python dependencies
_tandoor_venv_install
ynh_script_progression --message="Running migrations and generating static files..." --weight=2
pushd "$install_dir/source"
pushd "$install_dir"
(
source "$install_dir/.env"