farmcontrol-server/scripts/build-linux-packages.sh
Tom Butcher 997b374e0e
All checks were successful
farmcontrol/farmcontrol-server/pipeline/head This commit looks good
Add before-remove script for package uninstallation and streamline after-remove script
Introduce a new before-remove.sh script to stop and disable the farmcontrol-server service before package removal. Update after-remove.sh to only reload systemd, simplifying the uninstallation process. Modify build-linux-packages.sh to include the new before-remove script in the packaging process.
2026-07-26 22:56:42 +01:00

23 lines
621 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
version="$(node -p "require('./package.json').version")"
output_dir="app_dist/linux"
binary="${output_dir}/farmcontrol-server"
common_fpm_args=(
-f
-s dir
-n farmcontrol-server
-p "${output_dir}/"
-v "${version}"
--after-install packaging/linux/after-install.sh
--before-remove packaging/linux/before-remove.sh
--after-remove packaging/linux/after-remove.sh
"${binary}=/usr/bin/farmcontrol-server"
packaging/linux/farmcontrol-server.service=/lib/systemd/system/farmcontrol-server.service
)
fpm -t deb "${common_fpm_args[@]}"
fpm -t rpm "${common_fpm_args[@]}"