1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bookstack_ynh.git synced 2024-09-03 18:16:02 +02:00
This commit is contained in:
ericgaspar 2021-11-30 15:59:03 +01:00
parent c90a211a60
commit 5d9eb0a47a
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 21 additions and 38 deletions

View file

@ -83,6 +83,8 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
git clone --quiet https://github.com/BookStackApp/BookStack.git --branch release --single-branch $final_path
# Set permissions to app files # Set permissions to app files
chmod 755 $final_path chmod 755 $final_path
chmod -R o-rwx $final_path chmod -R o-rwx $final_path

View file

@ -60,28 +60,9 @@ ynh_system_user_create --username=$app --home_dir=$final_path
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
pushd $final_path
# Create a temporary directory git pull --quiet origin release && ynh_install_composer --install_args="--no-dev" && $phpversion artisan migrate
tmpdir="$(mktemp -d)" popd
cp -a "$final_path/.env " "$tmpdir/.env "
cp -a "$final_path/public/uploads" "$tmpdir/public/uploads"
cp -a "$final_path/storage/uploads" "$tmpdir/storage/uploads"
# Remove the app directory securely
ynh_secure_remove --file=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
cp -a "$tmpdir/.env " "$final_path/.env "
cp -a "$tmpdir/public/uploads" "$final_path/public/uploads"
cp -a "$tmpdir/storage/uploads" "$final_path/storage/uploads"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" #--keep="$final_path/.env $final_path/public/uploads $final_path/storage/uploads"
fi fi
chmod 755 $final_path chmod 755 $final_path
@ -111,25 +92,25 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
#================================================= # #=================================================
# INSTALL LYCHEE WITH COMPOSER # # INSTALL LYCHEE WITH COMPOSER
#================================================= # #=================================================
ynh_script_progression --message="Installing BookStack with Composer..." --weight=5 # ynh_script_progression --message="Installing BookStack with Composer..." --weight=5
# Install composer # # Install composer
ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_args="--no-dev" # ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_args="--no-dev"
#================================================= # #=================================================
# FINAL BOOKSTACK INSTALL # # FINAL BOOKSTACK INSTALL
#================================================= # #=================================================
ynh_script_progression --message="Install BookStack" --weight=5 # ynh_script_progression --message="Install BookStack" --weight=5
pushd $final_path # pushd $final_path
php$phpversion artisan migrate --no-interaction # php$phpversion artisan migrate --no-interaction
php$phpversion artisan cache:clear --no-interaction # php$phpversion artisan cache:clear --no-interaction
php$phpversion artisan config:clear --no-interaction # php$phpversion artisan config:clear --no-interaction
php$phpversion artisan view:clear --no-interaction # php$phpversion artisan view:clear --no-interaction
popd # popd
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX