41 lines
1.1 KiB
Bash
Executable File
41 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
envinit() {
|
|
apt-get install -y wget ca-certificates gnupg2 composer git php-simplexml php-gd
|
|
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg
|
|
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
|
|
apt-get update
|
|
apt-get install -y yarn
|
|
}
|
|
|
|
prebuild(){
|
|
VERSION=$1
|
|
git clone https://github.com/grocy/grocy.git /tmp/grocy
|
|
cd /tmp/grocy/
|
|
git checkout $VERSION
|
|
}
|
|
|
|
build() {
|
|
set +x
|
|
cd /tmp/grocy
|
|
composer install -n
|
|
yarn install
|
|
}
|
|
|
|
makedeb(){
|
|
PATH_BUILD=$1
|
|
PATH_DEB=$2
|
|
GIT_VERSION=$3
|
|
|
|
find ${PATH_BUILD}/tmp/grocy -name .gitignore -exec rm {} \;
|
|
cp -fr ${PATH_BUILD}/tmp/grocy/* ${PATH_DEB}/usr/share/grocy/
|
|
cp ${PATH_DEB}/usr/share/grocy/config-dist.php ${PATH_DEB}/etc/grocy/config.php
|
|
mv ${PATH_DEB}/usr/share/grocy/data ${PATH_DEB}/var/lib/grocy/
|
|
ln -s /var/lib/grocy/data/ ${PATH_DEB}/usr/share/grocy/data
|
|
ln -s /etc/grocy/config.php ${PATH_DEB}/usr/share/grocy/config.php
|
|
}
|
|
echo $1
|
|
FUNC=$1
|
|
shift
|
|
${FUNC} $*
|