this post was submitted on 11 Dec 2023
44 points (95.8% liked)

Programming

17408 readers
78 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

I'm trying to find a thing, and I'm not turning up anything in my web searches so I figure I'd ask the cool people for help.

I've got several projects, tracked in Git, that rely on having a set of command line tools installed to work on locally - as an example, one requires Helm, Helmfile, sops, several Helm plugins, Pluto, Kubeval and the Kubernetes CLI. Because I don't hate future me, I want to ensure that I'm installing specific versions of these tools rather than just grabbing whatever happens to be the latest version. I also want to ensure that my CI runner grabs the same versions, so I can be reasonably sure that what I've tried locally will actually work when I go to deploy it.

My current solution to this is a big ol' Bash script, which works, but is kind of a pain to maintain. What I'm trying to find is a tool where I:

  • Can write a definition, ideally somewhere shared between projects, of what it means to "install tool X"
  • Include a file in my project that lists the tools and versions I want
  • Run the tool on my machine and let it go grab the platform- and architecture- specific binaries from wherever, and install them somewhere that I can add to my $PATH for this specific project
  • Run the tool in CI and do the same - if it can cache stuff then awesome

Linux support is a must, other platforms would be nice as well.

Basically I'm looking for Pythons' pip + virtualenv workflow, but for prebuilt tools like helm, terraform, sops, etc. Anyone know of anything? I've looked at homebrew (seems to want to install system-wide), and VSCode dev containers (doesn't solve the CI need, and I'd still need to solve installing the tools myself)

you are viewing a single comment's thread
view the rest of the comments
[–] bigredgiraffe@lemmy.world 13 points 11 months ago (2 children)

I think what you are looking for can be found in rtx or asdf, I have used both for what you are describing, even those same tools hah. I’m currently using rtx more than asdf though for newer projects. I have been tempted by nix though, might take that plunge soon.

[–] metacat@programming.dev 5 points 11 months ago (1 children)

I recently started using rtx and I’m a big fan.

Works for a long list of tools and makes it very easy to remove lots of install commands and just do “rtx install” in any directory to install and switch to right versions of a set of tools. Also works great on CI using same configuration files.

[–] neidu@feddit.nl 2 points 11 months ago* (last edited 11 months ago)

Rtx on/off meme template;

"Off" is a greyscale picture of metacat struggling with manual dependencies. Possibly combined with "Isn't there a better way?" from ye olde shopping channel ads.

"On" Is a HDR image of a smiling metacat having no such issues. In the background a rainbow can be seen over a flowery garden, in which people are holding hands with rabbits frolicking in the grass.

Yeah yeah, I know, I'll go to bed now...

[–] RegalPotoo@lemmy.world 2 points 11 months ago (1 children)

Ended up going with rtx - thanks for the suggestion!

[–] bigredgiraffe@lemmy.world 2 points 11 months ago

Awesome! You bet, glad to hear it worked out.