mirror of
https://github.com/YunoHost-Apps/kimai2_ynh.git
synced 2024-09-03 19:26:26 +02:00
If version 0.3 then do symfony update & -n for doctrine:migrations in upgrade
This commit is contained in:
parent
74d748e9a2
commit
4ddf61d007
2 changed files with 19 additions and 8 deletions
|
@ -105,7 +105,7 @@ sudo_path () {
|
|||
|
||||
# Install and initialize Composer for upgrade script in the given directory
|
||||
# usage: init_composer DESTDIR [AS_USER]
|
||||
init_composer_update() {
|
||||
init_symfony_update() {
|
||||
local DESTDIR=$1
|
||||
local AS_USER=${2:-admin}
|
||||
|
||||
|
@ -115,10 +115,9 @@ init_composer_update() {
|
|||
sudo /usr/bin/php7.2 -- --install-dir="$DESTDIR" \
|
||||
|| ynh_die "Unable to install Composer"
|
||||
|
||||
# update dependencies to create composer.lock
|
||||
exec_composer "$DESTDIR" update symfony/flex --no-plugins --no-scripts
|
||||
exec_composer "$DESTDIR" install --no-dev --optimize-autoloader \
|
||||
|| ynh_die "Unable to update Kimai2 core dependencies"
|
||||
# update symfony
|
||||
exec_composer "$DESTDIR" update symfony/flex --no-plugins --no-scripts \
|
||||
|| ynh_die "Unable to update symfony for Kimai2"
|
||||
}
|
||||
|
||||
sudo_path () {
|
||||
|
|
|
@ -74,13 +74,25 @@ ynh_install_php7
|
|||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
# Download, check integrity, uncompress and patch the source from app.src and do required installation for update
|
||||
|
||||
#version check for 0.3
|
||||
version = sed -n 's/^future-release=//p' $final_path/.github_changelog_generator
|
||||
|
||||
# Uncompress latest sources
|
||||
ynh_setup_source "$final_path"
|
||||
init_composer_update $final_path
|
||||
|
||||
# If the version is 0.3, symfony update is required
|
||||
if [ "$version" = "0.3" ]
|
||||
then
|
||||
init_symfony_update $final_path
|
||||
fi
|
||||
|
||||
init_composer $final_path
|
||||
(
|
||||
cd $final_path && sudo /usr/bin/php7.2 bin/console cache:clear --env=prod
|
||||
cd $final_path && sudo /usr/bin/php7.2 bin/console cache:warmup --env=prod
|
||||
cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:migrations:migrate
|
||||
cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:migrations:migrate -n
|
||||
)
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
|
Loading…
Add table
Reference in a new issue