1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00
* Add parameters.yml

* Update upgrade

* add function
This commit is contained in:
eric_G 2024-07-20 14:19:28 +02:00 committed by GitHub
parent 686fb36ca0
commit d7c0790559
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 11 deletions

View file

@ -4,6 +4,12 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# Define a function to execute commands with `php_exec`
php_exec() {
(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} "$install_dir/bin/console" --no-interaction --env=prod "$@")
}
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================

View file

@ -45,22 +45,19 @@ ynh_add_config --template="parameters.yml" --destination="$install_dir/app/confi
chmod 600 "$install_dir/app/config/parameters.yml" chmod 600 "$install_dir/app/config/parameters.yml"
chown "$app:$app" "$install_dir/app/config/parameters.yml" chown "$app:$app" "$install_dir/app/config/parameters.yml"
# Alias for php-cli execution command
php_exec=("php$phpversion" "$install_dir/bin/console" --no-interaction --env=prod)
# Install dependencies and Wallabag # Install dependencies and Wallabag
ynh_exec_warn_less ynh_exec_as "$app" "${php_exec[@]}" wallabag:install php_exec wallabag:install
# Add users to Wallabag # Add users to Wallabag
for username in $(ynh_user_list); do for username in $(ynh_user_list); do
user_email=$(ynh_user_get_info --username="$username" --key=mail) user_email=$(ynh_user_get_info --username="$username" --key=mail)
# We don't care about that thanks to LDAP # We don't care about that thanks to LDAP
user_pass=$(ynh_string_random) user_pass=$(ynh_string_random)
ynh_exec_as "$app" "${php_exec[@]}" fos:user:create "$username" "$user_email" "$user_pass" php_exec fos:user:create "$username" "$user_email" "$user_pass"
done done
# Set admin user # Set admin user
ynh_exec_as "$app" "${php_exec[@]}" fos:user:promote --super "$admin" php_exec fos:user:promote --super "$admin"
# Configure Wallabag instance URL # Configure Wallabag instance URL
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \

View file

@ -32,12 +32,9 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring $app..." --weight=1 ynh_script_progression --message="Reconfiguring $app..." --weight=1
# Alias for php-cli execution command
php_exec=("php$phpversion" "$install_dir/bin/console" --no-interaction --env=prod)
# Upgrade database and clear the cache # Upgrade database and clear the cache
ynh_exec_as "$app" "${php_exec[@]}" doctrine:migrations:migrate php_exec doctrine:migrations:migrate
ynh_exec_as "$app" "${php_exec[@]}" cache:clear php_exec cache:clear
# Configure Wallabag instance URL # Configure Wallabag instance URL
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \