From fcb949881a0b12e9ccc3edb750efa6146cdced0a Mon Sep 17 00:00:00 2001 From: Solene Rapenne Date: Thu, 6 Oct 2022 22:29:41 +0200 Subject: [PATCH] bento: status now waits for changes in chroot dir in an infinite loop --- bento | 12 ++++++++---- doc/how-to.md | 4 +++- doc/reference.md | 6 ++++-- flake.nix | 4 ++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bento b/bento index 0874bf6..b163ad2 100755 --- a/bento +++ b/bento @@ -5,7 +5,7 @@ TIMEOUT=20 # FUNCTION LIBRARIES usage() { cat </dev/null 2>/dev/null done else display_status diff --git a/doc/how-to.md b/doc/how-to.md index 216373e..07b0b89 100644 --- a/doc/how-to.md +++ b/doc/how-to.md @@ -78,7 +78,9 @@ If you don't want to wait for the timer, you can ssh into the machine to run `sy As each host is sending a log upon rebuild to tell if it failed or succeeded, the files are used to check what happened since the sftp file `last_time_changed` was created. -Using `bento status` you can track the current state of each hosts (time since last update, current NixOS version, status report) +Using `bento status` you can track the current state of each hosts (time since last update, current NixOS version, status report). + +Bento will display the current state of the fleet, and wait for a change in the chroot directory to display the status again. [![asciicast](https://asciinema.org/a/520504.svg)](https://asciinema.org/a/520504) diff --git a/doc/reference.md b/doc/reference.md index 282ad32..4deb5b5 100644 --- a/doc/reference.md +++ b/doc/reference.md @@ -13,8 +13,10 @@ - dry-build or build configurations. Using `test` or `switch`, can be used to apply a configuration locally. Default is `build`. - when using `TARGET_IP`, the command is run on a remote server -- `bento status [delay]` - - display information for remote hosts, if `delay` is set, loop infinitely to display the status every `delay` seconds. Default delay is `0` and doesn't loop. +- `bento status` + - display information for remote hosts + - if the command is run in interactive mode, `bento` will run in an inifite loop the status display and wait for a change in the chroot directory + - if the command isn't run in interactive mode, the status is only displayed once and `bento` exits - `bento flake-update [input]` - recursively update flakes lock files diff --git a/flake.nix b/flake.nix index 7b8a743..c92ec15 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,10 @@ name = "bento"; src = self; + patchPhase = '' + substituteInPlace bento --replace 'inotifywait' "${pkgs.inotify-tools}/bin/inotifywait"; + ''; + installPhase = '' mkdir -p $out/bin mkdir -p $out/share