1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/firefly-iii_ynh.git synced 2024-09-03 18:36:13 +02:00

Merge pull request #34 from YunoHost-Apps/testing

Testing
This commit is contained in:
James Cole 2021-02-09 14:37:02 +01:00 committed by GitHub
commit c6a19a690f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 53 deletions

View file

@ -1,8 +1,6 @@
# See here for more informations # See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file # https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
@ -22,9 +20,6 @@
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
change_url=0 change_url=0
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto
;;; Options ;;; Options
Email=anmol@datamol.org Email=anmol@datamol.org
Notification=change Notification=change

View file

@ -15,7 +15,7 @@
"url": "https://datamol.org" "url": "https://datamol.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.0.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -13,6 +13,4 @@
## Package_check results ## Package_check results
--- ---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* * An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/firefly-iii_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/firefly-iii_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -101,12 +101,6 @@ then
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi fi
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# ...
#=================================================
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================

View file

@ -26,8 +26,7 @@ path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
random_key=$(ynh_string_random --length=32) random_key=$(ynh_string_random --length=32)
email=$(ynh_user_get_info --username=$admin --key=mail)
email=$(ynh_user_get_info $admin 'mail')
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -168,8 +167,8 @@ popd
ynh_script_progression --message="Securing files and directories..." ynh_script_progression --message="Securing files and directories..."
# Set right permissions # Set right permissions
chown -R $app:$app $final_path chown -R $app: $final_path
chmod -R 775 ${final_path}/storage chmod -R 775 $final_path/storage
#================================================= #=================================================
# SETUP A CRON # SETUP A CRON
@ -193,13 +192,12 @@ ynh_use_logrotate
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring permissions..."
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
# unprotected_uris allows SSO credentials to be passed anyway. ynh_permission_update --permission="main" --add="visitors"
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
fi fi
#================================================= #=================================================

View file

@ -25,7 +25,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
random_key=$(ynh_app_setting_get --app=$app --key=random_key) random_key=$(ynh_app_setting_get --app=$app --key=random_key)
email=$(ynh_user_get_info $admin 'mail') email=$(ynh_user_get_info --username=$admin --key=mail)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -60,6 +60,13 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -74,13 +81,6 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -104,18 +104,15 @@ then
cp -a "$final_path/storage/export/" "$tmpdir/storage/export/" cp -a "$final_path/storage/export/" "$tmpdir/storage/export/"
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$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"
# Restore the config file # Restore the config file
cp -a "$tmpdir/storage/upload/" "$final_path/storage/upload/" cp -a "$tmpdir/storage/upload/" "$final_path/storage/upload/"
cp -a "$tmpdir/storage/export/" "$final_path/storage/export/" cp -a "$tmpdir/storage/export/" "$final_path/storage/export/"
cp -a "$tmpdir/.env" "$final_path/.env" cp -a "$tmpdir/.env" "$final_path/.env"
# Remove temporary directory # Remove temporary directory
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi fi
#================================================= #=================================================
@ -157,7 +154,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
ynh_script_progression --message="Updating PHP dependencies..." ynh_script_progression --message="Updating PHP dependencies..."
chown -R "$app": "$final_path" chown -R $app: $final_path
ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
@ -190,7 +187,6 @@ ynh_replace_string --match_string="changeme@example.com" --replace_string="$app@
# ynh_replace_string --match_string="userprincipalname" --replace_string="uid" --target_file="$config" # ynh_replace_string --match_string="userprincipalname" --replace_string="uid" --target_file="$config"
ynh_replace_string --match_string="localhost" --replace_string="$domain$path_url" --target_file="$config" ynh_replace_string --match_string="localhost" --replace_string="$domain$path_url" --target_file="$config"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config" ynh_store_file_checksum --file="$config"
@ -200,15 +196,12 @@ ynh_store_file_checksum --file="$config"
ynh_script_progression --message="Deploying..." ynh_script_progression --message="Deploying..."
pushd "$final_path" pushd "$final_path"
ynh_secure_remove --file="bootstrap/cache/*"
rm -rf bootstrap/cache/*
php$phpversion artisan cache:clear php$phpversion artisan cache:clear
php$phpversion artisan migrate --seed php$phpversion artisan migrate --seed
php$phpversion artisan firefly-iii:upgrade-database php$phpversion artisan firefly-iii:upgrade-database
php$phpversion artisan passport:install php$phpversion artisan passport:install
php$phpversion artisan cache:clear php$phpversion artisan cache:clear
popd popd
#================================================= #=================================================
@ -228,7 +221,7 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files # Set permissions on app files
chown -R $app: $final_path chown -R $app: $final_path
chmod -R 775 ${final_path}/storage chmod -R 775 $final_path/storage
#================================================= #=================================================
# SETUP A CRON # SETUP A CRON
@ -241,18 +234,6 @@ ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app"
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app"
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# unprotected_uris allows SSO credentials to be passed anyway
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================