Shell vs Normal Programming Language
Rush opened this issue · comments
Thank you for building this project. I was trying out Shepherd and found some issues with it, making me look for alternatives.
First of all, I mean no offense with this question. Creating so much working shell code is impressive :)
Did you consider rewriting the code to a typed language such as Node.JS/TypeScript? But I believe even untyped would be better such as Python.
Program languages are just tools. Some language may be better at a particular set of jobs than others. I would use another language when there are some features of Docker service updater much easier to implement in the other language, but too difficult in shell. I won't rewrite the codes just because language A has a feature (like type support) that language B does not have. If I had to use another language, I would like to use a compiled language like C++, Go or Rust.
If you are looking for alternatives, I believe the following two are still maintained:
- In Python: https://github.com/ix-ai/cioban
- In Go: https://github.com/codestation/swarm-updater
What features are unique in Gantry:
- A working image remover to optionally remove updated images.
- Pre/Post run command to run other commands, like
docker system prune
. See this example. - Be able to add options to
docker service update
command and other docker commands, just in case someone needs them. - Well tested.
What features are missing in Gantry, but available in these two alternatives:
- Start as a service and trigger updating via web hooks.
Some of the features in Gantry is easier to implement and be customized by user thanks to it is shipped with the Docker CLI. It may lose some of these features to switch to another language, like pre/post command to run a docker
command.
You are of course correct, and thank you for highlighting alternatives.
On the challenges of shell scripting, I reported two issues and solving them seems more challenging in shell than it should be.