Giter Site home page Giter Site logo

bolstr / heroku-buildpack-sourceversion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sreid/heroku-buildpack-sourceversion

0.0 3.0 0.0 2 KB

Writes the SOURCE_VERSION variable (usually the Git SHA) to a file for use by the app

Shell 100.00%

heroku-buildpack-sourceversion's Introduction

heroku-buildpacks-sourceversion

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!

Usage

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...)

License

MIT

heroku-buildpack-sourceversion's People

Contributors

sreid avatar

Watchers

Shane Stanford avatar Jason Yanowitz avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.