add run_shell and run_python tools, deploy-suite target

This commit is contained in:
Fam Zheng
2026-04-10 21:47:14 +01:00
parent 8a5b65f128
commit c0e12798ee
2 changed files with 165 additions and 0 deletions

View File

@@ -40,6 +40,24 @@ deploy: test build noc.service
systemctl --user enable --now noc
systemctl --user restart noc
SUITE := noc
SUITE_DIR := noc
GITEA_VERSION := 1.23
deploy-suite: build
ssh $(SUITE) 'mkdir -p ~/bin /data/noc/tools ~/.config/systemd/user && systemctl --user stop noc 2>/dev/null || true'
scp target/release/noc $(SUITE):~/bin/
scp config.suite.yaml $(SUITE):/data/noc/config.yaml
scp noc.service.in $(SUITE):/data/noc/
scp -r tools/ $(SUITE):/data/noc/tools/
ssh $(SUITE) 'bash -lc "\
cd /data/noc \
&& sed -e \"s|@REPO@|/data/noc|g\" -e \"s|@PATH@|\$$PATH|g\" noc.service.in > ~/.config/systemd/user/noc.service \
&& systemctl --user daemon-reload \
&& systemctl --user enable --now noc \
&& systemctl --user restart noc \
&& systemctl --user status noc"'
deploy-hera: build
ssh $(HERA) 'mkdir -p ~/bin ~/$(HERA_DIR) ~/.config/systemd/user && systemctl --user stop noc 2>/dev/null || true'
scp target/release/noc $(HERA):~/bin/