1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kimai2_ynh.git synced 2024-09-03 19:26:26 +02:00
This commit is contained in:
ericgaspar 2021-09-27 11:52:36 +02:00
parent aa9902182b
commit b19d37188e
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 11 additions and 9 deletions

View file

@ -8,7 +8,7 @@ YNH_PHP_VERSION="7.3"
YNH_COMPOSER_VERSION="2.0.4"
extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3"
extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql"
#=================================================
# PERSONAL HELPERS

View file

@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=registration --value=$registration
ynh_app_setting_set --app=$app --key=random_key --value=$random_key
@ -94,6 +93,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
# Create a dedicated php-fpm config
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SPECIFIC SETUP
@ -122,11 +122,11 @@ ynh_add_config --template="../conf/.env.mysql" --destination="$final_path/.env"
#=================================================
ynh_script_progression --message="Building Kimai2..." --weight=1
ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--optimize-autoloader"
ynh_composer_exec --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --commands="require laminas/laminas-ldap"
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" --install_args="--optimize-autoloader"
ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="require laminas/laminas-ldap"
pushd "$final_path"
php${YNH_PHP_VERSION} bin/console kimai:install -n
php$phpversion bin/console kimai:install -n
popd
#=================================================

View file

@ -22,6 +22,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
registration=$(ynh_app_setting_get --app=$app --key=registration)
random_key=$(ynh_app_setting_get --app=$app --key=random_key)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK VERSION
@ -70,7 +71,7 @@ if ! ynh_permission_exists --permission="admin"; then
fi
if ! ynh_permission_exists --permission="super_admin"; then
ynh_permission_create --permission="super_admin" --allowed "$admin"
ynh_permission_create --permission="super_admin" --allowed="$admin"
fi
#=================================================
@ -146,6 +147,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie
ynh_script_progression --message="Configuring Kimai2..."
local_conf="$final_path/config/packages/local.yaml"
ynh_backup_if_checksum_is_different --file="$local_conf"
cp ../conf/local.yaml $local_conf
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$local_conf"
@ -164,11 +166,11 @@ ynh_add_config --template="../conf/.env.mysql" --destination="$final_path/.env"
#=================================================
ynh_script_progression --message="Upgrading Kimai2..."
ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--optimize-autoloader"
ynh_composer_exec --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --commands="require laminas/laminas-ldap"
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" --install_args="--optimize-autoloader"
ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="require laminas/laminas-ldap"
pushd "$final_path"
php${YNH_PHP_VERSION} bin/console kimai:update -n
php$phpversion bin/console kimai:update -n
popd
#=================================================