#variant (2019-05)
Discuss variant (the “Universal CLI”) https://github.com/mumoshu/variant
Archive: https://archive.sweetops.com/variant/
2019-05-01
what If config-file option is set then environment specific config files can't be loaded. why We want to be able to set the config file through the option and still be able to use environment s…
2019-05-03
what Add a command to install/uninstall remote dependencies defined by any source url why Mimic the terraform init -from-module=… pattern for anything as a way to initialize a project from rem…
any thoughts?
this is like your anydeps
but uses variant
without overloading helm
as package manager.
(as you can see the motivation is for #helmfile to fetch releases)
but will be also used to fetch binaries
though I confess i wrote this without looking at anydep
and now that I do see a bunch of things I can do better
General-purpose project/application dependency manager - mumoshu/anydep
also, I’m bummed that helm-s3
still doesn’t support public repos
General-purpose project/application dependency manager - mumoshu/anydep
yep, we shouldn’t be tied to helm-s3 nor s3.
anydep can be enhanced to leverage any helm plugin.
so perhaps we can add another backend (http, github, etc) to anydep and serve both use-cases of mine and your deps
2019-05-04
@Erik Osterman (Cloud Posse) I believe your approach does work and simpler, which is nice!
Your assumption would be that you don’t need transitive dependencies to be handled, right?
2019-05-07
yea, not for this stage
no deps of deps
i think a “package” system would be better then; perhaps why you chose helm
@mumoshu have you considered a “default” command? e.g. if none of the args match, pass $*
to some command
e.g. terraformctl
would intercept any task defined, but if not defined, it would pass to terraform
Haven’t tested it with deeply nested commands, but I’ve added the initial support for default commands.
The top-level script
is run when if is defined and no sub-task that matches the provided arguments found.
Wrap up your bash scripts into a modern CLI today. Graduate to a full-blown golang app tomorrow. - mumoshu/variant
its available since v0.29
wow, that’s clever. I like how you kept it consistent with the rest of variant. hadn’t thought to implement it that way, but i like it.
@Erik Osterman (Cloud Posse) sounds like a great addition to variant!
2019-05-08
@Erik Osterman (Cloud Posse) For variant (and also helmfile potentially) I got to think that we eventually need a tool like this:
https://github.com/mumoshu/versadep/blob/master/README.md
WDYT?
Versatile application dependency manager. Version, fetch, and generate any files and binaries required to run your application - mumoshu/versadep
the example config doesn’t make sense at all. please take it as purely for showing how the config syntax look like
Versatile application dependency manager. Version, fetch, and generate any files and binaries required to run your application - mumoshu/versadep
Wow, yes, I think you are on to something
Consider adding semver
fetch makes it easy to download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos. - gruntwork-io/fetch
But that is more for GitHub tags/release
thx for sharing!
probably we need to explore more sources other than github tags/releases as well, like curl
from any http sources as your deps
probably what need for versadep
would look something like a declarative fetch
+ additional sources?
oh, and i wanted versadep
to setup PATH
for us, like rbenv
does for ruby
Aha so you can vendor everything
exactly!
Btw have you ever explored terraform vendoring? Not easy
not at all. i’d love to know your experience!
For modules.. that nest modules. Only bringing it up because it’s something we’ve been tasked with solving at some point
can you nest terraform modules? i wonder how it works when multiple modules refer to/nest different versions of the module
yep, we do extreme nesting
sometimes 3-4 levels deep. maybe more.
terraform clones every reference of a module to .terraform/modules
each one checked out to the version referenced
it uses some hashed folder which is presumably the github url with version info
Extracted from our official slack channel: have you considered a "default" command? e.g. if none of the args match, pass $* to some command (edited) e.g. terraformctl would intercept any …
2019-05-09
Here’s a quick intro to variant I recorded for one of our developers: https://zoom.us/recording/play/4tqm82NFwAwrKQKyDPrLRiKnpoQQ3QVP0vgQzqs6ReXioWAU5msjIn9t4jfn8Fe6?continueMode=true
I just came to know about variant
i am not sure what advantage does variant have over regular bash scripts
consistent interface
proper arg validatin
very terse
most bash scripts have very poor argument handling
yep, and it provides a “upgrade path” to a golang app
you can use variant build
and some scripts to produce a single executable that runs without variant
and even add extra commands written in golang to your cmd written in yaml
so if you feel outgrown from bash
, variant allows you to gradually/fully migrate to golang
.
so potentially we could replace https://github.com/cloudposse/geodesic/blob/master/rootfs/usr/local/bin/s3 with variant ?
Geodesic is a cloud automation shell. It's the fastest way to get up and running with a rock solid, production grade cloud platform built on top of strictly Open Source tools. ★ this repo! h…
Yes
2019-05-10
@rohit I think about it like this: makefile is good for the wrapping bash scripts (and other executables), and variant is better than makefile to do it
2019-05-11
@Maycon Santos has joined the channel
2019-05-23
the next idea: https://github.com/mumoshu/variant/issues/86
As an ordinary engineer I often write documentation for my one-off scripts in GitHub Flavored Markdown. But it tends to get outdated quickly due to various reasons, including I just forget updating…