Replies: 3 comments 2 replies
-
Hello! Mage would be a perfect fit to replace/drive/some hybrid of your existing bash stuff. Here's an example of a magefile I have for my home k8s cluster: https://github.com/CowDogMoo/Walls-of-Excellence/blob/main/magefiles/magefile.go Here's another example of a magefile I have for my go utilities: https://github.com/l50/goutils/blob/main/magefiles/magefile.go You don't need to swear off bash completely either - there are tons of wonderful helper functions in mage. Here's an example of one: The beauty of mage in my opinion is the means to use the same functions you use for writing code in administrative utilities. If you write decent tests for your functions, you'll find a lot of happiness in the stability and reliability of this workflow. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Happy to help, I'm very excited about the incredible things that this project provides. A good reason to use the mage installdeps versus (what I used to do): pushd .mage
go build -o ../magefile
popd
./magefile installdeps |
Beta Was this translation helpful? Give feedback.
-
I've made my first stab at Magefiles for kubernetes-sigs/sig-windows-dev-tools#259 Disclaimer: I've never written a single line in Go and this is my first attempt. It's been a very pleasant experience, thanks to Mage too! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm new to Go and to Mage too. I've accidentally learned about Mage from kubernetes-sigs/sig-windows-dev-tools#203 and it intrigued me quite a bit, so I started reading about it.
The documentation says this:
I'm eagerly looking for elaboration of this statement especially in context of general purpose scripting in Bash.
I maintain repositories with IasC where I also develop numerous Bash scripts - not Makeiles - for local execution as well as execution via CI/CD pipelines, for example:
kubectl
and Azure CLI to harvest details/inventory of platform/cluster resources and generate reports (Markdown, HTML)I'm interested to learn potential advantages and disadvantages if I switched to writing Magefiles instead of Bash.
Since I'm new to Go, a language ubiquitous in cloud and Kubernetes ecosystems, swithing to Mage would be an opportnity to learn Go with real purpose which I already see as a huge advantage. But, I'm wondering if there would be any serious technical disadvantages or even blockages hit by Mage in comparison to Bash.
Beta Was this translation helpful? Give feedback.
All reactions