The Next Generation Platform is Coming - Get Ready Now!
GitHub Readme.md
Writes the SOURCE_VERSION variable (usually the Git SHA) to a file for use by the app.
Created by @sreid out of the need to show which Git commit version of an app was running on a Heroku instance. Made possible by the addition of the SOURCE_VERSION variable during the build process. This variable is available during the build process, but not available to a running app, making this approach neccessary. Suggestions and improvements appreciated!
To use this buildpack, the app should already be successfully running the multi buildpack.
Then just add this buildpack in addition to the existing buildpacks in the .buildpacks
file:
https://github.com/sreid/heroku-buildpack-sourceversion.git
In the application code, read the .source_version
file that will be created on deployment. For example, in a Rails, it might look something like:
git_sha = File.read(Rails.root.join('.source_version'))
(add any error handling for environments where this file doesn't exist, such as your development machine, of course...)
MIT
Copy the snippet above into CLI.
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.