m-lab / etl-gardener

Gardener provides services for maintaining and reprocessing mlab data.
Apache License 2.0
13 stars 5 forks source link

Embed a static git commit hash in the gardener binary #324

Closed stephen-soltesz closed 3 years ago

stephen-soltesz commented 3 years ago

Currently, etl-gardener reads the "GIT_COMMIT" value from its runtime environment, which could be out of sync with reality. This change embeds the real git commit as a static variable at build time.

This change simplifies configuration and supports an effort to migrate the gardener deployment to cloudbuild.


This change is Reviewable

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.06%) to 60.479% when pulling 654fac0cfba5ec29cae62aee4de4faf8ba673a31 on sandbox-soltesz-static-gitcommit into c272940d0384fa531f9b3a622b4e739d46747160 on master.

stephen-soltesz commented 3 years ago

The command to read the local Version: git describe --tags does not work as intended b/c CB uses a shallow git clone without all of the tags and history available. I think this is okay for now, b/c afaict, this value didn't work before either.

Ultimately, I'd like to populate this with either the branch (for sandbox and staging) or the tag (prod).