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

Use ynh_setup_source

This commit is contained in:
Jean-Baptiste Holcroft 2017-10-19 11:33:09 +02:00
parent fd03685a3d
commit 982222a4ab
4 changed files with 7 additions and 26 deletions

4
conf/app.src Normal file
View file

@ -0,0 +1,4 @@
SOURCE_URL=https://github.com/kanboard/kanboard/releases/download/v1.0.41/kanboard-1.0.41.zip
SOURCE_SUM=825885960c65f7817d9fc34ca5ac8c36ef637ed285bcdb2bf3f5569bf64c9ff2
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip

View file

@ -1,28 +1,5 @@
#!/bin/bash
#
# Common variables
#
# Application version
VERSION="1.0.41"
# Remote URL to fetch application source archive
APPLICATION_SOURCE_URL="https://kanboard.net/kanboard-${VERSION}.zip"
#
# Common helpers
#
# Download and extract application sources to the given directory
# usage: extract_application_to DESTDIR
extract_application() {
local DESTDIR=$1
TMPDIR=$(mktemp -d)
chmod 755 $TMPDIR
archive="${TMPDIR}/application.zip"
wget -q -O "$archive" "$APPLICATION_SOURCE_URL" \
|| ynh_die "Unable to download application archive"
unzip -qq "$archive" -d "$TMPDIR" \
|| ynh_die "Unable to extract application archive"
rm "$archive"
sudo rsync -a "$TMPDIR"/*/* "$DESTDIR"
}

View file

@ -45,7 +45,7 @@ ynh_app_setting_set $app mysqlpwd $dbpass
ynh_app_setting_set $app adminusername $admin
ynh_app_setting_set $app is_public $is_public
extract_application "$DESTDIR"
ynh_setup_source "$DESTDIR"
# Copy and edit config.php
sudo cp ../conf/config.php ${DESTDIR}

View file

@ -39,7 +39,7 @@ sudo rm -rf /var/lib/php5/session/*
# Move old app dir
sudo mv ${DESTDIR} ${DESTDIR}.old
extract_application "$DESTDIR"
ynh_setup_source "$DESTDIR"
# restore data
sudo cp -a ${DESTDIR}.old/data ${DESTDIR}