mirror of
https://github.com/YunoHost-Apps/kimai2_ynh.git
synced 2024-09-03 19:26:26 +02:00
symfony/flex --no-plugins & clear and warmup the cache
This commit is contained in:
parent
ec018210ad
commit
436fe9d924
2 changed files with 25 additions and 3 deletions
|
@ -95,8 +95,7 @@ init_composer() {
|
|||
|| 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 --prefer-dist --no-scripts \
|
||||
exec_composer "$DESTDIR" install --no-dev --optimize-autoloader \
|
||||
|| ynh_die "Unable to update Kimai2 core dependencies"
|
||||
}
|
||||
|
||||
|
@ -104,6 +103,27 @@ sudo_path () {
|
|||
sudo env "PATH=$PATH" $@
|
||||
}
|
||||
|
||||
# Install and initialize Composer for upgrade script in the given directory
|
||||
# usage: init_composer DESTDIR [AS_USER]
|
||||
init_composer_update() {
|
||||
local DESTDIR=$1
|
||||
local AS_USER=${2:-admin}
|
||||
|
||||
# install composer for upgrade script
|
||||
curl -sS https://getcomposer.org/installer \
|
||||
| COMPOSER_HOME="${DESTDIR}/.composer" \
|
||||
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
|
||||
exec_composer "$DESTDIR" install --no-dev --optimize-autoloader \
|
||||
|| ynh_die "Unable to update Kimai2 core dependencies"
|
||||
}
|
||||
|
||||
sudo_path () {
|
||||
sudo env "PATH=$PATH" $@
|
||||
}
|
||||
#
|
||||
# php7.2 helpers
|
||||
#
|
||||
|
|
|
@ -76,7 +76,9 @@ ynh_install_php7
|
|||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
init_composer $final_path
|
||||
init_composer_update $final_path
|
||||
cd $final_path && sudo /usr/bin/php7.2 cache:clear --env=prod
|
||||
cd $final_path && sudo /usr/bin/php7.2 cache:warmup --env=prod
|
||||
cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:migrations:migrate
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
|
Loading…
Add table
Reference in a new issue