#variant (2019-04)
Discuss variant (the “Universal CLI”) https://github.com/mumoshu/variant
Archive: https://archive.sweetops.com/variant/
2019-04-02
How do I ensure the latest version of Variant is on my module?
Also is this expected?
✅ (healthera-sandbox-iac) pod ➤ variant version -v
loading config file variant.yaml...missing
loading env file .varenv...missing
version
tried with and without the verbose flag
On 0.27.1 in ubuntu CLI:
oscar@infinitum:~$ variant version
version
@oscarsullivan_old good catch! something seems wrong with the version command. It should print v0.27.1
at least
How do I ensure the latest version of Variant is on my module?
there’s no way currently. i was thinking that you’ll prefer wrapping the whole variant command up into a docker image, so that you can tie a specific version of variant and your variant command
but that’s not always the case?
i wonder if it helps to add variantVersion
that is written in your variant command like:
variantVersion: 0.27.0
so that running ./yourcmd
on a machine with an older or newer version of variant immediately fails
wdyt?
Are you saying every command that is run has a version output?
Sounds like two ideas there.
How would you get the latest version for idea 2 to compare against?
Are you saying every command that is run has a version output?
no
How would you get the latest version for idea 2 to compare against?
Not sure I’m following you correctly, but I’d fix variant to properly embed its own version(like 0.27.0). So that when your variant command gets loaded by the variant(as the runtime), variant can see what version of runtime is required by the command wants, and validate if its own version matches the required version
@mumoshu you are correct that in our case we can just check what version of the apk
is installed
though if variant
is installed natively without a package manager, there’s really no way to know what version is installed
yes, i have no good idea how we force embed the version number when it is installed natively with go get
oh yea, not with go get
(though I have never understood why go get
is so popular when you cannot even select what eversion you go get
)
ah ok
it’s like you go get some random version that happens to be at master
at the particular instant
i’ve fixed variant version
to properly show the version number for releases
$ ./variant version
0.27.2
Something like https://stackoverflow.com/a/11355611/1237191
Is it possible to increment a minor version number automatically each time a Go app is compiled? I would like to set a version number inside my program, with an autoincrementing section: $ myapp -
yes, i have no good idea how we force embed the version number when it is installed natively with go get
one thing I’ve seen (and considered implementing at cloudposse) is adding a sentinel file for the version that is committed in the repo
that way even releases are peer reviewed
and then have the CI system apply the release tag from the sentinel file on merge to master
this is what we do, with bumpversion
I thought you can do go get x@v22
Oh wait that’s go_install
yea, there are some 3rd party tools that will do it
I might sound a bit uncertain because I use Ansible to install go packages
Installs the Go programming language and packages on Mac & Linux (Ubuntu, CentOS) - fubarhouse/ansible-role-golang
Can share playbook and examples if Ansible is a path you would be interested in for managing them
might be interesting for #ansible ?
there’s also http://labix.org/gopkg.in
Stable APIs for the Go language
but i think it only pins to major version, which was a major bummer when i looked at it last
2019-04-03
thx for sharing
2019-04-17
@mumoshu do you want a motto for variant?
“One glue to glue them all”
2019-04-19
@mumoshu probably we can discuss it: https://github.com/mumoshu/variant/issues/73#issuecomment-484868234
Hello, Your tool is great but I faced with some problem. I don't know may be it already supported but I didn't find examples how to do it. Let's me explain. You have next example of usa…
2019-04-25
@mumoshu hey, please check: https://github.com/mumoshu/variant/pull/74
WHAT: Add custom colors for log messages. WHY: For some cases, we want to allow to set custom colors for every type of log messages (panic, fatal, error, warn, info, debug, trace). For example, man…
thx for the pr! will take a look asap
WHAT: Add custom colors for log messages. WHY: For some cases, we want to allow to set custom colors for every type of log messages (panic, fatal, error, warn, info, debug, trace). For example, man…
2019-04-30
WHAT: Allow log level to be customized through the environment variable, e.g.: VARIANT_LOG_LEVEL="warn" WHY: We want to allow to set the custom log level for "variant". For exam…