l3nz

l3nz

I am releasing SayCheezEx, a library to capture the build time environment in a very simple and concise way.

When I deploy a release, I always want it to embed its own version, Git sha revision, when it was built… all that stuff. An I never remember the exact Git incantations, and sometimes different versions of Git are slightly incompatible on date formatting.

So I just create a module attribute like:

@version cheez! "{:project_version}/{:git_commit_id} {:build_number} on {:build_on}"

And SayCheez takes care of the rest. It can access a set of attributes SayCheezEx — say_cheez_ex v0.3.6 and/or the environment variables, with defaults if they should not be found. It can try multiple items (because sometimes there is a different environment on different CI servers) until one is found.

I mean, it’s not rocket science, but it’s pretty handy.

You can find it on GitHub at GitHub - l3nz/say_cheez_ex: Say Cheez! for Elixir · GitHub

Comments welcome.

Showing Posts 1 to 4

l3nz

l3nz OP

Version 0.2.2 is out, with a major bug fix and a number of new system attributes (thanks @voltone for help!). Some of the attributes are as below:

  build_at: "230411.1538",
  build_at_day: "2023-04-11",
  build_at_full: "2023-04-11.15:38:40",
  build_by: "lenz",
  build_number: "87",
  build_on: "MacBook-Pro.local",
  build_mix_env: "dev",
  git_all: "b204919/230411.1509",
  git_commit_id: "b204919",
  git_commit_id_full: "b2049190312ef810875476398978c2b0387251d3",
  git_date: "2023-04-11.15:09:50",
  git_date_compact: "230411.1509",
  git_last_committer: "Lenz",
  project_full_version: "0.2.1/b204919/230411.1509",
  project_name: "SayCheezEx",
  project_version: "0.2.1",
  sysinfo_arch: "aarch64-apple-darwin22.3.0",
  sysinfo_banner: "Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]",
  sysinfo_beam: "BEAM jit 13.2",
  sysinfo_c_compiler: "gnuc 4.2.1",
  sysinfo_compat: "25",
  sysinfo_driver: "3.3",
  sysinfo_nif: "2.16",
  sysinfo_ptr: "64bit",
  sysinfo_word: "64bit",
  system: "1.14.3/OTP25",
  system_elixir: "1.14.3",
  system_otp: "25",
olivermt

olivermt

It is a funny name, but I would consider SEO here as well. If I had the need to find build time capturing on hex I would never find this lib :stuck_out_tongue:

l3nz

l3nz OP

I just did some test searching with keywords on hex.pm and the results appear pretty random. Take a project description, paste it almost verbatim, and you get a ton of other projects.

l3nz

l3nz OP

As a Saturday morning activity, I released a new version (0.3.5) that prints captured values on stdout only when building in environment :prod. This should make logging less noisy.

Version 0.3. introduced Graphviz / PlantUML graphs to be embedded in the project ExDocs - so you can easily create, e.g. diagrams of the inter-dependencies between multiple Gen Servers.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews