E

Inquiry on Go build ldflags usage

Summary

The user is inquiring about how to include COMMIT_SHA and VERSION in Go build ldflags, noting that these values change with each commit. They express a desire to run the process only when necessary and suggest using secrets to pass this information, as changing a secret does not trigger a cache bust in Earthly. They acknowledge the suggestion and thank the responder.

Status
resolved
Tags
    Source
    #earthly
      b

      brandon356

      8/13/2024

      That's true. I'll use that method thank you.

      v

      vlad

      8/13/2024

      It's kind of a hack, but you could pass this information as secrets. A secret being changed doesn't cause a cache bust in Earthly.

      b

      brandon356

      8/13/2024

      Is there a way to add COMMIT_SHA and VERSION to a Go build ldflags? Normally this would change with every commit, so I'd like to only run if required