#variant (2019-05)

https://github.com/mumoshu/variant

Discuss variant (the “Universal CLI”) https://github.com/mumoshu/variant

Archive: https://archive.sweetops.com/variant/

2019-05-23

mumoshu avatar
mumoshu
feat: Markdown-based alternative syntax · Issue #86 · mumoshu/variant

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…

2019-05-11

Maycon Santos avatar
Maycon Santos
07:04:46 PM

@Maycon Santos has joined the channel

2019-05-10

tolstikov avatar
tolstikov

@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

:--1:2
2

2019-05-09

Erik Osterman avatar
Erik Osterman
1
:100:1
rohit avatar
rohit

I just came to know about variant

rohit avatar
rohit

i am not sure what advantage does variant have over regular bash scripts

Erik Osterman avatar
Erik Osterman

consistent interface

Erik Osterman avatar
Erik Osterman

proper arg validatin

Erik Osterman avatar
Erik Osterman

very terse

Erik Osterman avatar
Erik Osterman

most bash scripts have very poor argument handling

mumoshu avatar
mumoshu

yep, and it provides a “upgrade path” to a golang app

mumoshu avatar
mumoshu

you can use variant build and some scripts to produce a single executable that runs without variant

mumoshu avatar
mumoshu

and even add extra commands written in golang to your cmd written in yaml

mumoshu avatar
mumoshu

so if you feel outgrown from bash, variant allows you to gradually/fully migrate to golang.

rohit avatar
rohit

it is currently flying over my head, i will have to check it out

:--1:1
rohit avatar
rohit

i guess i will start with @Erik Osterman intro video

1
rohit avatar
rohit
cloudposse/geodesic

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…

Erik Osterman avatar
Erik Osterman

Yes

Erik Osterman avatar
Erik Osterman

Everything new we do is in variant

:--1:3

2019-05-08

mumoshu avatar
mumoshu

@Erik Osterman 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?

mumoshu/versadep

Versatile application dependency manager. Version, fetch, and generate any files and binaries required to run your application - mumoshu/versadep

mumoshu avatar
mumoshu

the example config doesn’t make sense at all. please take it as purely for showing how the config syntax look like

mumoshu/versadep

Versatile application dependency manager. Version, fetch, and generate any files and binaries required to run your application - mumoshu/versadep

Erik Osterman avatar
Erik Osterman

Wow, yes, I think you are on to something

Erik Osterman avatar
Erik Osterman

Sec developing/forming opinion

:--1:1
Erik Osterman avatar
Erik Osterman

Consider adding semver

Erik Osterman avatar
Erik Osterman
gruntwork-io/fetch

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

Erik Osterman avatar
Erik Osterman

But that is more for GitHub tags/release

mumoshu avatar
mumoshu

thx for sharing!

mumoshu avatar
mumoshu

probably we need to explore more sources other than github tags/releases as well, like curl from any http sources as your deps

mumoshu avatar
mumoshu

probably what need for versadep would look something like a declarative fetch + additional sources?

mumoshu avatar
mumoshu

oh, and i wanted versadep to setup PATH for us, like rbenv does for ruby

Erik Osterman avatar
Erik Osterman

Aha so you can vendor everything

mumoshu avatar
mumoshu

exactly!

Erik Osterman avatar
Erik Osterman

Btw have you ever explored terraform vendoring? Not easy

mumoshu avatar
mumoshu

not at all. i’d love to know your experience!

Erik Osterman avatar
Erik Osterman

For modules.. that nest modules. Only bringing it up because it’s something we’ve been tasked with solving at some point

1
mumoshu avatar
mumoshu

can you nest terraform modules? i wonder how it works when multiple modules refer to/nest different versions of the module

Erik Osterman avatar
Erik Osterman

yep, we do extreme nesting

Erik Osterman avatar
Erik Osterman

sometimes 3-4 levels deep. maybe more.

Erik Osterman avatar
Erik Osterman

terraform clones every reference of a module to .terraform/modules

Erik Osterman avatar
Erik Osterman

each one checked out to the version referenced

Erik Osterman avatar
Erik Osterman

it uses some hashed folder which is presumably the github url with version info

mumoshu avatar
mumoshu
feat: default commands · Issue #85 · mumoshu/variant

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-07

Erik Osterman avatar
Erik Osterman

yea, not for this stage

Erik Osterman avatar
Erik Osterman

no deps of deps

Erik Osterman avatar
Erik Osterman

i think a “package” system would be better then; perhaps why you chose helm

Erik Osterman avatar
Erik Osterman

@mumoshu have you considered a “default” command? e.g. if none of the args match, pass $* to some command

Erik Osterman avatar
Erik Osterman

e.g. terraformctl would intercept any task defined, but if not defined, it would pass to terraform

mumoshu avatar
mumoshu

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.

https://github.com/mumoshu/variant#default-command

mumoshu/variant

Wrap up your bash scripts into a modern CLI today. Graduate to a full-blown golang app tomorrow. - mumoshu/variant

mumoshu avatar
mumoshu

its available since v0.29

Erik Osterman avatar
Erik Osterman

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.

:--1:1
Erik Osterman avatar
Erik Osterman

basically, using variant to overload commands

:--1:1
mumoshu avatar
mumoshu

@Erik Osterman sounds like a great addition to variant!

2019-05-04

mumoshu avatar
mumoshu

@Erik Osterman 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-03

Erik Osterman avatar
Erik Osterman
Add deps command by osterman · Pull Request #466 · cloudposse/geodesic

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…

Erik Osterman avatar
Erik Osterman

any thoughts?

Erik Osterman avatar
Erik Osterman

this is like your anydeps but uses variant without overloading helm as package manager.

Erik Osterman avatar
Erik Osterman

(as you can see the motivation is for #helmfile to fetch releases)

Erik Osterman avatar
Erik Osterman

but will be also used to fetch binaries

Erik Osterman avatar
Erik Osterman

though I confess i wrote this without looking at anydep and now that I do see a bunch of things I can do better

Erik Osterman avatar
Erik Osterman
mumoshu/anydep

General-purpose project/application dependency manager - mumoshu/anydep

Erik Osterman avatar
Erik Osterman

also, I’m bummed that helm-s3 still doesn’t support public repos

mumoshu/anydep

General-purpose project/application dependency manager - mumoshu/anydep

mumoshu avatar
mumoshu

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-01

tolstikov avatar
tolstikov
bug: If config-file option is set then environment specific config files can't be loaded · Issue #78 · mumoshu/variant

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…

1
    keyboard_arrow_up