debmaker/ressources/budibase/debmaker

48 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
VERSION=2.0.27
APP=budibase
DEPOT=https://github.com/Budibase/budibase.git
GIT_VERSION=last
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=20
PACKAGE_DEPENDENCY="yarn nodejs"
main(){
base_package_upgrade
envinit
get_git_source
build
makedeb
}
envinit() {
configure_depot_yarn
configure_depot_nodejs
install_package_dependency
}
build() {
cd /tmp/${APP}
npm install -g yarn jest lerna --force
yarn
yarn bootstrap
yarn build
rm -fr /tmp/${APP}/packages/*/build
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
mkdir -p ${PATH_DEB}/opt/budibase/
mv /tmp/budibase/packages/* ${PATH_DEB}/opt/budibase/
mkdir -p ${PATH_DEB}/opt/budibase/server/client
cp ${PATH_DEB}/opt/budibase/client/manifest.json ${PATH_DEB}/opt/budibase/server/client
cp ${PATH_DEB}/opt/budibase/client/dist/budibase-client.js ${PATH_DEB}/opt/budibase/server/client
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}