Giter VIP home page Giter VIP logo

Comments (5)

brianmay avatar brianmay commented on June 19, 2024 1

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"),
  [...]

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 19, 2024

We build our ghcr images with just pr-xxxx right now, innit?
So agree a commit id would be great

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 19, 2024

If you want to change the version in a PR, just update the version file...

from teslamate.

micves avatar micves commented on June 19, 2024

We build our ghcr images with just pr-xxxx right now, innit?
So agree a commit id would be great

I think the image name is fine 👍 This way you can just pull without changing anything and get a new image from the PR.
The idea was to get some output indicating that it was actually updated (log and/or web)

If you want to change the version in a PR, just update the version file...

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:
https://elixirforum.com/t/generating-app-mix-version-directly-from-git-tags/16685/7

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 :)

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 19, 2024

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.

from teslamate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.