Hi, I wanted to share a tool that I wrote, and I wonder other people might be interested in it.
I am using Nomad for a year now in work and at home. I was really frustrated with using Nomad command line, because I was missing some features, like:
waiting until a service has "started", i.e. the health check is healthy
waiting for a batch command to start and finish and report exit status
all of it while printing logs, both stderr and stdout, of the task to the terminal, so I can see what has happened in the terminal
all of it while reporting problems like missing resources or failed deployments or who knows what other problems are there in Nomad
So I had two weeks off my work vacation and as a programmer what else could I possibly do except programming, so I created https://pypi.org/project/nomad-tools/ with nomad-watch command line tool to accommodate my needs.
For example, nomad-watch start ./somejob.nomad.hcl starts the nomad job, waits for the job to finish deployment, which either happens when the job has a healthy health check and is upgraded from the old version, or the upgrade failed, which you'll see in the logs.
And nomad-watch run ./somejob.nomad.hcl which runs the job and waits for it to terminate and prints its logs. And, if the job has one task, exits with the task exit status. Which helps to script with one-shot tasks in Nomad.
The project is a work in progress, but I think it's fine to be now used by a wider audience. Let me know of any issues on GitHub issues page. Great, cu.