{"id":26957161,"url":"https://github.com/l3nz/say-cheez","last_synced_at":"2026-03-12T07:01:39.705Z","repository":{"id":62434580,"uuid":"155756337","full_name":"l3nz/say-cheez","owner":"l3nz","description":"Capture build environment information to display at runtime","archived":false,"fork":false,"pushed_at":"2019-11-08T08:25:47.000Z","size":27,"stargazers_count":30,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-31T07:56:59.575Z","etag":null,"topics":["build-automation","clojure","clojure-library","continuous-integration"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l3nz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-01T18:10:25.000Z","updated_at":"2025-09-06T18:44:36.000Z","dependencies_parsed_at":"2022-11-01T21:01:50.954Z","dependency_job_id":null,"html_url":"https://github.com/l3nz/say-cheez","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/l3nz/say-cheez","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l3nz%2Fsay-cheez","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l3nz%2Fsay-cheez/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l3nz%2Fsay-cheez/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l3nz%2Fsay-cheez/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l3nz","download_url":"https://codeload.github.com/l3nz/say-cheez/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l3nz%2Fsay-cheez/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30158971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-automation","clojure","clojure-library","continuous-integration"],"created_at":"2025-04-03T03:38:36.706Z","updated_at":"2026-03-12T07:01:39.688Z","avatar_url":"https://github.com/l3nz.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Say-cheez :)\n\nCaptures a snapshot of the environment at build time, so you can display it at run-time.\n\nSometimes you'd want to reference the version of your package\nat run time, or when / where / from what sources it was built, but that information\nis not available anymore once you deploy your app somewhere else. \n\nIt can also be useful to run a pipeline once when building, e.g. compiling a SASS file\ninto CSS and storing the result as a string.\n\n\n[![Clojars Project](https://img.shields.io/clojars/v/say-cheez.svg)](https://clojars.org/say-cheez)\n[![](https://cljdoc.xyz/badge/say-cheez)](https://cljdoc.xyz/jump/release/say-cheez)\n![ClojarsDownloads](https://img.shields.io/clojars/dt/say-cheez)\n\n\n##  Example\n\nLook at this namespace:\n\n\t(ns baab.baah\n\t\t(:require [say-cheez.core :refer [capture-build-env-to]]))\n\t....\n\t(capture-build-env-to BUILD)\n\nThe var called `BUILD` is exactly the same as if you wrote by hand:\n\n\t(defonce BUILD \n\t    {:project\n    \t\t{:arch \"x86_64\",\n\t    \t :git-build \"e4b7836/2018-11-03.14:45:31\",\n\t\t     :osname \"gnu-linux\",\n\t    \t :project \"say-cheez\",\n\t\t     :built-at \"2018-11-03.14:49:25\",\n\t    \t :built-by \"jenkins\",\n\t\t     :on-host \"jenkins18.loway.internal\",\n\t    \t :version \"0.0.2\",\n\t\t     :build-no \"107\"}})\n\nBut that would be pretty annoying to do by hand, because such information comes from different places: \n\n* project.clj\n* the build environment\n* git\n* when the project was built\n\nAnd would not usually be available at run time.\n\n### Creating your own DEFs\n\nThe problem with the approach above is that linters may not understand that \n`BUILD` was defined at all, so they might display it as \"broken\" in your\nIDE or raise an exception. \n\nTo make them happy, you can define `BUILD` by yourself:\n\n\t(ns baab.baah\n\t\t(:require [say-cheez.core :refer [current-build-env]]))\n\t....\n\t(def BUILD (current-build-env))\n\nPlease note that `current-build-env` has a couple of minor differences to `capture-build-env-to`:\n\n* It does not print the captured value (so you can have a 'silent' build)\n* It does not nest the captured value under a `:project` key, as it is\n  just a value that you can nest yourself.\n\n\n\n### Customizing values\n\nOf course, you can capture the exact values you need if our own chili is not to your taste.\n\n\t\t(capture-to MYBUILD {:project (leiningen-info :project-name)\n\t\t                     :myId    (env [\"MY_OWN_ID\"] \"?\")})\n\nor, to avoid creating a silent def:\n\n        (def ABC (capture {:project (leiningen-info :project-name)\n\t\t                   :myId    (env [\"MY_OWN_ID\"] \"?\")})\n\t\t               \nor even:\n\n        (def ABC (capture {:project (leiningen-info :project-name)\n\t\t                   :myId    (env [\"MY_OWN_ID\"] \"?\")}\n\t\t                   \"value of ABC\")\n\t\t                     \nwhere, during compile, the value computed will be printed out as \"value of ABC\".\n\n\nYou can call any function and build any valid data structure.\n\nStill, we offer some convenience functions to make your life easier:\n\n* *Current time:* `(now-as :datetime)`. Also valid: \n\t* `:date`\n    * `:time`\n    * `:timec`   (compact)\n    * `:datetime`\n* *Build Environment:* `(env [\"A\" \"B\"] \"x\")`. Tries reading first A and then B, and if all are undefined, returns \"x\". You may reasonably want to look for a sequence of environment variables if you build on different machines / OS's.\n* *Leiningen:* `(leiningen-info :project-name)`. Also valid:\n    * `:project-name`\n    * `:version`\n* *Git:* `(git-info :all)`. Also valid:\n    * `:commit-id`\n    * `:commit-long`\n    * `:last-committer`\n    * `:date`\n    * `:date-compact`\n    * `:all`    - *abcdefg/20181103.1023*\n* *Runtime:* this is useful if you have a long running application - maybe close to the version and build number, you want to print the current memory usage. I surely do. So call `(runtime :mem)`. Also valid:\n  * `:pid` - the current PID - under the JVM we also get the hostname\n  * `:vm`  - the kind of VM we are running in\n  * `:mem` - current memory state - e.g. `\"141/1590M 9% used\"`\n\nAbout the runtime, under `platform` there is a function to set the current thread's name.\n\n## Using\n\nThe library is available on Clojars, or the library can be easily referenced through Github:\n\n\t{:deps\n\t {cli-matic\n\t  {:git/url \"https://github.com/l3nz/say-cheez.git\"\n\t   :sha \"...\"}}}\n\n\n## Features\n\n* Captures some environment (project name, date, version, build number, git commit) at build time\n* Has a couple of functions for inspecting runtime JVM and PID.\n* By separating the Java specific functions in the namespace \"platform\", it should be easy (?)\n  to extend for ClojureScript.\n\nTODO:\n\n* Reading edn/json/cvs files, so they appear as a var and you do not have to read them. \n\n### Transitive dependencies\n\nSay-cheez currently depends on:\n\n* org.clojure/clojure\n\n## License\n\nThe use and distribution terms for this software are covered by the\nEclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)\nwhich can be found in the file epl.html at the root of this distribution.\nBy using this software in any fashion, you are agreeing to be bound by\nthe terms of this license.\n\nYou must not remove this notice, or any other, from this software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl3nz%2Fsay-cheez","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl3nz%2Fsay-cheez","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl3nz%2Fsay-cheez/lists"}