1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/crabfit_ynh.git synced 2024-09-03 18:16:21 +02:00

Remove cache and temporary files from the install_dir (lighter backups)

This commit is contained in:
Antoine Lima 2024-03-09 22:06:10 +01:00
parent 7c0cb6d68d
commit 288fc6dc4a
No known key found for this signature in database
GPG key ID: 5D1E65E3DEB73410
2 changed files with 6 additions and 1 deletions

View file

@ -10,7 +10,7 @@ Group=__APP__
WorkingDirectory=__INSTALL_DIR__/api WorkingDirectory=__INSTALL_DIR__/api
StandardOutput=append:/var/log/__APP__/__APP__-back.log StandardOutput=append:/var/log/__APP__/__APP__-back.log
StandardError=inherit StandardError=inherit
ExecStart=__INSTALL_DIR__/api/target/release/crabfit-api ExecStart=__INSTALL_DIR__/crabfit-api
# Sandboxing options to harden security # Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these # Depending on specificities of your service/app, you may need to tweak these

View file

@ -34,12 +34,15 @@ function build_backend
# Remove build files and rustup # Remove build files and rustup
ynh_secure_remove --file="$install_dir/api/.cargo" ynh_secure_remove --file="$install_dir/api/.cargo"
ynh_secure_remove --file="$install_dir/api/.rustup" ynh_secure_remove --file="$install_dir/api/.rustup"
mv target/release/crabfit-api ..
ynh_secure_remove --file="$install_dir/api/target"
popd popd
} }
function build_frontend function build_frontend
{ {
ynh_script_progression --message="Building crabfit frontend..." --weight=1 ynh_script_progression --message="Building crabfit frontend..." --weight=1
pushd $install_dir/frontend pushd $install_dir/frontend
# Paths are currently absolute, which breaks having a /api/ path prefix # Paths are currently absolute, which breaks having a /api/ path prefix
# TODO: MR to the upstream # TODO: MR to the upstream
@ -50,6 +53,8 @@ function build_frontend
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" $nodejs_path/yarn install --production --frozen-lockfile ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" $nodejs_path/yarn install --production --frozen-lockfile
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" $ynh_npm run build ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" $ynh_npm run build
popd popd
ynh_secure_remove --file="$install_dir/.cache"
} }
#================================================= #=================================================