2022-02-12 18:30:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-02-28 23:26:47 +01:00
|
|
|
APP=gotify
|
2023-07-11 23:00:08 +02:00
|
|
|
VERSION=2.2.4
|
2022-02-28 23:26:47 +01:00
|
|
|
GIT_VERSION=v$VERSION
|
2022-08-05 04:46:20 +02:00
|
|
|
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
|
2023-07-11 23:00:08 +02:00
|
|
|
DEBIAN_VERSION_CODENAME=bullseye
|
2022-08-05 04:46:20 +02:00
|
|
|
IMAGE_SIZE=6
|
2022-09-10 18:11:22 +02:00
|
|
|
DEPOT=https://github.com/gotify/server.git
|
|
|
|
PACKAGE_DEPENDENCY="build-essential nodejs yarn"
|
2022-02-28 23:26:47 +01:00
|
|
|
|
2022-12-04 03:31:12 +01:00
|
|
|
main(){
|
|
|
|
base_package_upgrade
|
2023-07-11 23:00:08 +02:00
|
|
|
envinit
|
|
|
|
get_git_source
|
|
|
|
build
|
|
|
|
makedeb
|
|
|
|
}
|
|
|
|
|
|
|
|
envinit() {
|
2022-08-17 20:35:16 +02:00
|
|
|
configure_depot_yarn
|
|
|
|
configure_depot_nodejs
|
2022-09-10 18:11:22 +02:00
|
|
|
install_package_dependency
|
2022-08-17 20:35:16 +02:00
|
|
|
install_go
|
2022-02-12 18:30:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2022-08-05 04:46:20 +02:00
|
|
|
cd /tmp/${APP}
|
2022-02-20 15:02:18 +01:00
|
|
|
PATH=${PATH}:/usr/local/go/bin
|
|
|
|
export GO111MODULE=on
|
|
|
|
make download-tools
|
|
|
|
go get -d
|
|
|
|
(cd ui && yarn && yarn build)
|
|
|
|
go run hack/packr/packr.go
|
|
|
|
go build -ldflags="$LD_FLAGS" -o gotify-server
|
2022-02-12 18:30:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
makedeb(){
|
2022-02-24 00:02:53 +01:00
|
|
|
PATH_DEB=/tmp/src/rootfs
|
2022-08-05 04:46:20 +02:00
|
|
|
|
|
|
|
cp /tmp/${APP}/gotify-server ${PATH_DEB}/usr/bin/
|
2022-09-10 18:11:22 +02:00
|
|
|
chmod +x ${PATH_DEB}/usr/bin/gotify-server
|
2022-08-05 04:46:20 +02:00
|
|
|
cp /tmp/${APP}/config.example.yml ${PATH_DEB}/etc/gotify/config.yml
|
2022-02-20 23:33:43 +01:00
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
2022-02-24 00:02:53 +01:00
|
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
2022-02-12 18:30:28 +01:00
|
|
|
}
|