49 lines
1.6 KiB
Bash
Executable file
49 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
[ -e ./lib/function.sh ] && source ./lib/function.sh
|
|
|
|
APP=wallabag
|
|
VERSION=2.4.3
|
|
GIT_VERSION=$VERSION
|
|
DEB_VERSION=$VERSION-3
|
|
DEBIAN_VERSION_CODENAME=bullseye
|
|
IMAGE_SIZE=2
|
|
|
|
STEP="envinit prebuild build makedeb"
|
|
|
|
envinit() {
|
|
apt-get install -y --no-install-recommends wget ca-certificates composer git php-common php-xml php-json php-gd php-mbstring php-xml php-tidy php-curl php-tokenizer php-bcmath php-intl php-fpm unzip fakeroot dpkg
|
|
}
|
|
|
|
prebuild(){
|
|
GIT_VERSION=$1
|
|
git clone --depth 1 -b ${GIT_VERSION} https://github.com/wallabag/wallabag.git /tmp/wallabag
|
|
}
|
|
|
|
build() {
|
|
cd /tmp/wallabag
|
|
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist -n --no-scripts
|
|
}
|
|
|
|
makedeb(){
|
|
GIT_VERSION=$1
|
|
DEB_VERSION=$2
|
|
PATH_DEB=/tmp/src/rootfs
|
|
|
|
cp -fr /tmp/wallabag/app ${PATH_DEB}/usr/share/wallabag/app
|
|
cp -fr /tmp/wallabag/src ${PATH_DEB}/usr/share/wallabag/src
|
|
cp -fr /tmp/wallabag/vendor ${PATH_DEB}/usr/share/wallabag/vendor
|
|
cp -fr /tmp/wallabag/web ${PATH_DEB}/usr/share/wallabag/web
|
|
echo need by synfony to find project directory > ${PATH_DEB}/usr/share/wallabag/composer.json
|
|
|
|
cp -fr /tmp/wallabag/data ${PATH_DEB}/var/lib/wallabag/data
|
|
cp -fr /tmp/wallabag/var ${PATH_DEB}/var/lib/wallabag/var
|
|
|
|
cp /tmp/wallabag/app/config/parameters.yml.dist ${PATH_DEB}/etc/wallabag/parameters.yml
|
|
|
|
ln -s /var/lib/wallabag/data ${PATH_DEB}/usr/share/wallabag/data
|
|
ln -s /var/lib/wallabag/var ${PATH_DEB}/usr/share/wallabag/var
|
|
ln -s /etc/wallabag/parameters.yml ${PATH_DEB}/usr/share/wallabag/app/config/parameters.yml
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
|
}
|