Heroku - Display hash of current commit in browser

前端 未结 9 1617
逝去的感伤
逝去的感伤 2020-12-02 14:45

I want to display the hash of the current git commit in the browser so that testing team (which does not have an access to run heruko commands) will be able to include the c

9条回答
  •  心在旅途
    2020-12-02 14:49

    It's now possible to try the Heroku feature Roberto wrote about in his answer, without contacting Heroku. It's called Heroku Labs: Dyno Metadata and you can enable it by

    heroku labs:enable runtime-dyno-metadata -a 
    

    and then the information is available (on the next deploy) as environment variables:

    ~ $ env
    HEROKU_APP_ID:                   9daa2797-e49b-4624-932f-ec3f9688e3da
    HEROKU_APP_NAME:                 example-app
    HEROKU_DYNO_ID:                  1vac4117-c29f-4312-521e-ba4d8638c1ac
    HEROKU_RELEASE_VERSION:          v42
    HEROKU_SLUG_COMMIT:              2c3a0b24069af49b3de35b8e8c26765c1dba9ff0
    HEROKU_SLUG_DESCRIPTION:         Deploy 2c3a0b2
    ...
    

提交回复
热议问题