From 0b39fe765a9affaaa6c389f8489bc517bc31458f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 2 Mar 2021 22:07:25 +0100 Subject: [PATCH] Testing (#14) * Upgrade to version 0.31.6 --- README.md | 2 +- README_fr.md | 2 +- check_process | 6 ++++++ conf/app.src | 4 ++-- manifest.json | 2 +- scripts/install | 11 ++--------- scripts/upgrade | 41 +++++++++++++++++++++-------------------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 9c3c2a0..05cb0bb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ BookStack is a simple, self-hosted, easy-to-use platform for organising and stor BookStack is built using PHP, on top of the Laravel framework and it uses MySQL to store data. -**Shipped version:** 0.31.5 +**Shipped version:** 0.31.6 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 74920f9..5499b0d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Overview BookStack est une plate-forme simple, auto-hébergée et facile à utiliser pour organiser et stocker des informations. -**Version incluse :** 0.31.5 +**Version incluse :** 0.31.6 ## Screenshots diff --git a/check_process b/check_process index caa5497..7f19c1c 100644 --- a/check_process +++ b/check_process @@ -15,6 +15,7 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=a1db7396ceab19640e68d6a8cc05befd1f9c07ad backup_restore=1 multi_instance=1 port_already_use=0 @@ -22,3 +23,8 @@ ;;; Options Email= Notification=none +;;; Upgrade options + ; commit=a1db7396ceab19640e68d6a8cc05befd1f9c07ad + name=Testing (#11) + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& + diff --git a/conf/app.src b/conf/app.src index 418733f..2327a36 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/BookStackApp/BookStack/archive/v0.31.5.tar.gz -SOURCE_SUM=76e46d9d481f6aabc47c86ec4dac9218b5a927ab1930933758943168009f545e +SOURCE_URL=https://github.com/BookStackApp/BookStack/archive/v0.31.6.tar.gz +SOURCE_SUM=6c6a0d57a9ca824d9556720ea976d90fdba62c74dfb08be2c020e5dd5dd1288e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 7d901f5..ac952a7 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Platform to create documentation/wiki content", "fr": "Plateforme pour créer du contenu de documentation/wiki " }, - "version": "0.31.5~ynh1", + "version": "0.31.6~ynh1", "url": "https://www.bookstackapp.com/", "license": "MIT", "maintainer": { diff --git a/scripts/install b/scripts/install index e2f6aae..ef0a425 100644 --- a/scripts/install +++ b/scripts/install @@ -103,15 +103,8 @@ ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_ar # MODIFY A CONFIG FILE #================================================= -cp -a ../conf/.env.example $final_path/.env - -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.env" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.env" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/.env" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.env" -ynh_replace_string --match_string="__MAIL_PWD__" --replace_string="$(ynh_string_random --length=12)" --target_file="$final_path/.env" +mail_pwd=$(ynh_string_random --length=12) +ynh_add_config --template=../conf/.env.example --destination=$final_path/.env ynh_store_file_checksum $final_path/.env diff --git a/scripts/upgrade b/scripts/upgrade index 2b14fba..87060d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,8 +53,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/.env" "$tmpdir/.env" + + # 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" + + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/.env" "$final_path/.env" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi #================================================= @@ -82,36 +97,22 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= -# PHP-FPM CONFIGURATION +# INSTALL LYCHEE WITH COMPOSER #================================================= -ynh_script_progression --message="Upgrading Composer..." --weight=1 +ynh_script_progression --message="Installing BookStack with Composer..." --weight=5 +# Install composer ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_args="--prefer-source --no-dev" -#================================================= -# MODIFY A CONFIG FILE -#================================================= - -cp -a ../conf/.env.example $final_path/.env - -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.env" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.env" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/.env" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.env" -ynh_replace_string --match_string="__MAIL_PWD__" --replace_string="$(ynh_string_random --length=12)" --target_file="$final_path/.env" - -ynh_store_file_checksum $final_path/.env - #================================================= # FINAL BOOKSTACK INSTALL #================================================= ynh_script_progression --message="Install BookStack" --weight=5 pushd $final_path - php$phpversion artisan key:generate --no-interaction --force - php$phpversion artisan migrate --no-interaction --force + php artisan migrate --no-interaction \ + && php artisan cache:clear --no-interaction \ + && php artisan view:clear --no-interaction popd #=================================================