2.3 KiB
gomanager
description
Go Manager is a program that watches your package binaries and if they're not the same version of your installed go version, it rebuilds the packages. By default it is ran every 24 hours. It does not use fnotify or similar. It's a simple tool which checks the current Go version vs the version of the complied binaries.
You MUST be root to run all commands
scenario
You have go projects which you git clone
and go build
.
You can't be arsed to keep the built binaries up to date, manually, every time a new Go version is released.
Gomanager does this job for you, periodically.
install
pre-requisites
a functioning build environment
CentOS/RHEL/Rocky/Alma etc
yum groupinstall 'Development Tools'
Debian/Ubuntu
apt install build-essentials
Archlinux
pacman -S base-devel
Default installation procedure
CGO_ENABLED=1 go install code.icod.de/dalu/gomanager@latest
mv ~/go/bin/gomanager /usr/local/bin/
gomanager setup
Default update procedure
CGO_ENABLED=1 go install code.icod.de/dalu/gomanager@latest
mv ~/go/bin/gomanager /usr/local/bin/
usage
all commands can have -h
added for a help screen.
add project
gomanager add \
--root-path="" \
--binary-path="" \
--service-name="" \
remove project
Find out the ID of a watched project with gomanager list
gomanager remove --id 1
list projects
gomanager list
show logs of a project
Find out the ID of a watched project with gomanager list
gomanager logs --id 1
start/run
This starts the periodic watcher in the foreground, which runs every 24 hours. It is advised to use a systemd or other init script to run this in the background, supervised.
gomanager start
systemd service
read the contrib directory The runner is ran every 24 hours.
cron job
This runs the watcher every day a 2am
crontab -e
0 2 * * * /usr/local/bin/gomanager cron
systemd timer
see the
- contrib/gomanager-cron.service
- contrib/gomanager-cron.timer
copy to /etc/systemd/system/
and
systemctl enable --now gomanager-cron.timer
uninstall
gomanager clean
rm /usr/local/bin/gomanager