1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kimai2_ynh.git synced 2024-09-03 19:26:26 +02:00

Updated to version 0.4 and symfony fix for version 0.3

* Updated to version 0.4

* symfony fix

* symfony fix

* symfony fix

* symfony fix

* symfony fix

* symfony fix

* symfony fix

* symfony fix

* symfony/flex --no-plugins & clear and warmup the cache

* Forgot  bin/console in upgrade script

* Added bin/console doctrine:migrations:version --add --all to install

* symfony-cmd: not found fix

* cd fix for update script

* Added -n for doctrine:migrations:version in install
This commit is contained in:
anmol26s 2018-09-05 11:06:40 -04:00 committed by GitHub
parent 280a850ada
commit 61095ebcdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 6 deletions

View file

@ -3,7 +3,7 @@
[![Integration level](https://dash.yunohost.org/integration/kimai2.svg)](https://ci-apps.yunohost.org/jenkins/job/kimai2%20%28Community%29/lastBuild/consoleFull)
[![Install kimai2 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=kimai2)<br>
Shipped Version: **0.3 (pre-release)**
Shipped Version: **0.4 (pre-release)**
**Please note that this app will install PHP 7.2**

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/kevinpapst/kimai2/archive/0.3.tar.gz
SOURCE_SUM=87e1b544c4483e4c11cf96fa44aca9bd71fac3a168155cd10b9922ab22e92678
SOURCE_URL=https://github.com/kevinpapst/kimai2/archive/0.4.tar.gz
SOURCE_SUM=2bfe446b5aeca3facfc2903cad4ca33fe04e8e71e45c1ecfe31669b08d31afe1
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -6,7 +6,7 @@
"en": "Kimai2 package for YunoHost.",
"fr": "Kimai2 de package dapplication pour YunoHost."
},
"version": "0.3",
"version": "0.4",
"url": "https://v2.kimai.org",
"license": "free",
"maintainer": {

View file

@ -95,7 +95,7 @@ init_composer() {
|| ynh_die "Unable to install Composer"
# update dependencies to create composer.lock
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"
}
@ -103,6 +103,26 @@ sudo_path () {
sudo env "PATH=$PATH" $@
}
# Install and initialize Composer for upgrade script in the given directory
# usage: init_composer DESTDIR [AS_USER]
init_symfony_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 symfony
exec_composer "$DESTDIR" update symfony/flex --no-plugins --no-scripts \
|| ynh_die "Unable to update symfony for Kimai2"
}
sudo_path () {
sudo env "PATH=$PATH" $@
}
#
# php7.2 helpers
#

View file

@ -127,6 +127,8 @@ init_composer $final_path
cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:schema:create
cd $final_path && sudo /usr/bin/php7.2 bin/console cache:warmup --env=prod
cd $final_path && sudo /usr/bin/php7.2 bin/console kimai:create-user "$admin" "$email" ROLE_SUPER_ADMIN "$admin_pass"
cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:migrations:version --add --all -n
#=================================================
# SETUP APPLICATION

View file

@ -74,9 +74,26 @@ 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' /var/www/kimai2/.github_changelog_generator`
# Uncompress latest sources
ynh_setup_source "$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 -n
)
#=================================================
# NGINX CONFIGURATION
#=================================================