BUILD_INFO - best practices to show the deployed version, deploy time etc #1102
Closed
tillcarlos
started this conversation in
General
Replies: 1 comment
-
Okay, after several hours of trying:
Josef said "I wouldn't try to attach a file to it, although you technically could.": https://x.com/strzibnyj/status/1845363108765671713 My solution is the following now: Placing a JSON string into ENV and reading it into the admin dashboard: module DeployedVersionHelper
def read_build_info
# Default to empty JSON string if BUILD_INFO is not set
build_info = ENV.fetch("BUILD_INFO", "{}")
JSON.parse(build_info)
rescue JSON::ParserError, Errno::ENOENT => e
{
contents: build_info,
error: e.to_s
}
end
end This gets called from the gitlab CI, but also in a post-commit hook: generate_build_info.sh https://gist.github.com/tillcarlos/7a9944a186e0b0c0df04223a496f9961 I deploy with this command: If someone wants more details, I'm happy to share. Right now, I'd consider this as closed. Thanks everyone! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all
Showing the version of the current deployment makes debugging easier. It gives testers confidence that they are working on the correct version.
My Main Question: What's the best practice to achieve this?
I am trying to find an elegant way to do this. What does work for me is this:
What's a bit hard is this:
Has anyone seen a great solution that we can adopt as a semi standard for all our deployments?
Beta Was this translation helpful? Give feedback.
All reactions