Elixir project version

I’m working on a build/deploy pipeline using exrm, and I’d really prefer for version to come from git tags, and not from a property within mix.exs. When I pass the version to mix release, it takes…but then relx breaks (I think because there is nothing to satisfy the mix version’s notion of my app). I would very much appreciate advice on either why I shouldn’t be doing what I’m doing, or how I might fix it.

More generally, version to me seems like something above the code, and not something inherit in the code itself. If anyone has information about how it came to live within the code (either for elixir or in other ecosystems) and not outside, I’d also be interested in that.

2 Likes

I created a mix task that read the actual version, updates it in the mix.exs file, tag and push the tag on the remote. We use it to trigger a deploy to production.

I kinda like the fact that the version is in the codebase. Even if it creates some problem.

So you have a mix task that updates the value in mix.exs?

Yes! Exactly.

Sounds like that would make a good elixir library that people could add to their project to add such a mix task? *hint*hint*

1 Like