debmaker/ressources/metabase/metabase

41 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=metabase
VERSION=0.42.2
GIT_VERSION=v$VERSION
DEB_VERSION=$VERSION-1
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=10
STEP="envinit prebuild build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot openjdk-17-jdk curl
wget -qO - https://deb.nodesource.com/setup_16.x | bash
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 nodejs yarn
curl https://download.clojure.org/install/linux-install-1.10.3.1087.sh | bash
}
prebuild(){
git clone --depth 1 -b ${GIT_VERSION} https://github.com/metabase/metabase.git /tmp/metabase
}
build() {
cd /tmp/metabase/
PATH=$PATH:/usr/local/bin
./bin/build
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp /tmp/metabase/target/uberjar/metabase.jar ${PATH_DEB}/usr/share/metabase/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}