Introducing Trackman: Execute Commands as a Workflow
Join the DZone community and get the full member experience.Join For Free
Today, we would like to introduce you to Trackman, the open-source, execute-commands-as-a-workflow tool. In this post, we take a closer look at what it is, why we need it, and how to best implement the tool. Let's get started.
What Is Trackman?
Trackman is a command-line tool and Go library that runs multiple commands in a workflow. It supports parallel steps, step dependencies, async steps, and success checkers.
Why Do I Need Trackman?
Most of us are familiar with Bash (or other Shell) scripts: a simple way to run commands in order. Bash, as a scripting language, is a powerful and flexible way to do almost anything you want in Linux. On Windows, this is true for PowerShell scripts.
When deploying our applications to Kubernetes, we often find ourselves running command sequences like this:
- Wait for the installation to complete successfully
kubectl apply -f some_file.yml
- Wait for it to successfully start the application
- Run some migration job, like a database schema migration.
While putting all these commands in a Bash script is possible, we can observe a pattern here: run a command, check to see it's done right, and move on to the next step.
Trackman is a way to just do that: run commands, check they ran fine, then run the next step.
If you want some more complex workflows, Trackman can run steps in parallel, define dependencies between them (A depends on B and C's successful completion), run some "pre-flight" checks before running a step, and some more.
How Do I Use Trackman?
Trackman can run as a single executable on Linux, Mac, or Windows without any dependencies. It can also be used as a library in a Golang project if you would like to add its functionality to another tool you are building. To learn more about Trackman, you can check out this Trackman repository or watch our Trackman pre-release webinar:
We currently use Trackman to simplify Cloud 66 Skycap deployments. Trackman is also integrated into the Cloud 66 Toolbelt. In the future, Trackman will add support for Notifiers (to notify an external entity of a step's run progress) and re-tries and more. In the meantime, please check it out and feel free to let us know your thoughts in the comments below!
Published at DZone with permission of Khash Sajadi, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.