-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend version with more build info #3682
Comments
In my Elixir projects I have: Dockerfile: # Setup access to version information
ARG BUILD_DATE=date
ARG VCS_REF=vcs
ENV BUILD_DATE=${BUILD_DATE}
ENV VCS_REF=${VCS_REF} In the build, I use a custom action to pass the appropriate values for these args. I did these with a github action, but maybe we won't have to do that here(???): https://github.com/brianmay/docker-meta/blob/main/index.js I notice I have an extra variable here for VERSION to which I don't consume. Curious. I may have forgotten to update the project. And there is a bit of logic here to pass the branch name, tag, or whatever to generate the version. I actually can't remember why I did it this way anymore. You should be able to use these predefined variables: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables Then I read these values in the elixir config: config :xxx,
build_date: System.get_env("BUILD_DATE"),
vcs_ref: System.get_env("VCS_REF"),
[...] |
We build our ghcr images with just pr-xxxx right now, innit? |
If you want to change the version in a PR, just update the version file... |
I think the image name is fine 👍 This way you can just pull without changing anything and get a new image from the PR.
I always forget to update things like that :D Maybe something like this could be nice where the version is detected automatically from the latest tag: And bumbed if not on tag. That means it would work for the edge image as well. If no one beats me to it, I might try it out in a PR at some point :) |
Yeah, I used the version bumping in the past as well, but this will not update the log output in elixir from what I get, therefore TeslaMate uses the version file. |
It could be useful to have some more info than just the version number when testing out PR's
It could be just a log output when starting teslamate, but might also be handy on settings on web.
I guess we would need something like this to be able to backtrace it completely:
Originally posted by @micves in #3658 (reply in thread)
The text was updated successfully, but these errors were encountered: