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

Merge pull request #66 from YunoHost-Apps/testing

Testing
This commit is contained in:
Maniack Crudelis 2017-11-25 13:37:26 +01:00 committed by GitHub
commit d7bc1f6c1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 2 deletions

32
scripts/_common.sh Normal file
View file

@ -0,0 +1,32 @@
#!/bin/bash
# =============================================================================
# COMPOSER
# =============================================================================
# Execute a composer command from a given directory
# usage: composer_exec workdir COMMAND [ARG ...]
exec_composer() {
local workdir=$1
shift 1
COMPOSER_HOME="${workdir}/.composer" \
php "${workdir}/composer.phar" $@ \
-d "${workdir}" --quiet --no-interaction
}
# Install and initialize Composer in the given directory
# usage: init_composer destdir
init_composer() {
local destdir=$1
# install composer
curl -sS https://getcomposer.org/installer \
| COMPOSER_HOME="${destdir}/.composer" \
php -- --quiet --install-dir="$destdir" \
|| ynh_die "Unable to install Composer"
# update dependencies to create composer.lock
exec_composer "$destdir" install --no-dev \
|| ynh_die "Unable to update Roundcube core dependencies"
}

View file

@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
@ -114,6 +114,16 @@ cp ../conf/config.inc.php $final_path
# Recalculate and store the config file checksum into the app settings # Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.inc.php" ynh_store_file_checksum "$final_path/config.inc.php"
#=================================================
# INSTALL DEPENDENCIES
#=================================================
# Install composer
init_composer "$final_path"
# Install dependencies
exec_composer "$final_path" update --no-dev
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -6,7 +6,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
# source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
@ -130,6 +130,16 @@ cp ../conf/config.inc.php $final_path
# Recalculate and store the config file checksum into the app settings # Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.inc.php" ynh_store_file_checksum "$final_path/config.inc.php"
#=================================================
# INSTALL DEPENDENCIES
#=================================================
# Install composer
init_composer "$final_path"
# Install dependencies
exec_composer "$final_path" update --no-dev
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================