Create a debian package
The deploy process would be greatly simplified with a debian package. No more having to go through a manual build and deploy process, we could just build the package, and install it. Unfortunately, several of the go dependencies aren't packaged. Specifically, we're missing golang-github-pion-sdp-dev, golang-github-pion-stun-dev, golang-github-pion-webrtc.v3-dev, and golang-snowflake-dev.
I tried a custom build script instead of dh-golang
, but it didn't go very well. I ended up getting the build working right, but not the install. I'm documenting my efforts here in case someone wants to try to pick it up in the future.
Here's the rules file I came up with. I had to install dart-sass and go manually. That's because dart-sass is not packaged, and debian's version of go is too old (1.15, needs 1.17 for the net.IP.IsPrivate method).
#!/usr/bin/make -f
%:
#dh $@ --builddirectory=_build --buildsystem=golang --with=golang
python3 -m venv /tmp/venv
. /tmp/venv/bin/activate
curl -fsSL -o /tmp/dart-sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.70.0/dart-sass-1.70.0-linux-x64.tar.gz
tar xC /tmp -f dart-sass.tar.gz
curl -fsSL -o /tmp/go.tar.gz https://go.dev/dl/go1.21.6.linux-amd64.tar.gz
tar xC /tmp -f go.tar.gz
pip install lektor pybabel
pip install -r frontend/lego/lektor-requirements.txt
env PATH="/tmp/dart-sass:/tmp/go/bin:$$PATH" bash build.sh
override_dh_auto_install:
dh_auto_install -- --no-source