How to make SOURCE_VERSION or Latest Git tag available to Node.js app on Heroku with Docker?

Viewed 59

How can I get my app (hosted on Heroku) to know the current version at runtime? Either using the commit sha or git tag as the version number would do (preferably without maintaining and committing an extra version file to the repo)?

When using Buildpacks on Heroku you can leverage $SOURCE_VERSION or call git to get latest tag and then write a file to .profile.d in $BUILD_DIR/$ENV_DIR to make an environment variable available at runtime.

How can we do the same when deploying via Docker and a heroku.yml config file?

0 Answers
Related