1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prettynoemiecms_ynh.git synced 2024-09-03 20:06:36 +02:00

Working on install

This commit is contained in:
massyas 2018-04-27 10:30:15 +02:00
parent 7050b90a40
commit a57bd732d1
3 changed files with 38 additions and 11 deletions

View file

@ -10,4 +10,38 @@
ynh_delete_file_checksum () {
local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_'
ynh_app_setting_delete $app $checksum_setting_name
}
}
# Package dependencies
pkg_dependencies="php5-cli php5-common php5-intl php5-json git"
# composer from roundcube_ynh
# 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"
# install composer.json
cp "${destdir}/composer.json-dist" "${destdir}/composer.json"
# update dependencies to create composer.lock
exec_composer "$destdir" install --no-dev \
|| ynh_die "Unable to install app using composer"
}

View file

@ -77,7 +77,7 @@ ynh_app_setting_set $app port $port
# INSTALL DEPENDENCIES
#=================================================
ynh_install_app_dependencies git
ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -88,7 +88,8 @@ ynh_app_setting_set $app final_path $final_path
#ynh_setup_source "$final_path"
git clone "https://framagit.org/framasoft/PrettyNoemieCMS" "$final_path"
cd "$final_path"
composer install
init_composer "$final_path"
#=================================================
# NGINX CONFIGURATION

View file

@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port)
db_name=$(ynh_app_setting_get $app db_name)
db_user=$db_name
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
@ -47,13 +46,6 @@ fi
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db $db_user $db_name
#=================================================
# REMOVE APP MAIN DIR
#=================================================