Reflecting Heroku push version within the app

后端 未结 9 630
故里飘歌
故里飘歌 2021-01-30 09:17

Every time I push my app to heroku I see the line

-----> Launching... done, v43

Is there a way to make that version number apear within the

9条回答
  •  野的像风
    2021-01-30 09:58

    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:                   
    HEROKU_APP_NAME:                 example-app
    HEROKU_DYNO_ID:                  
    HEROKU_RELEASE_VERSION:          v42
    HEROKU_SLUG_COMMIT:              
    HEROKU_SLUG_DESCRIPTION:         Deploy 2c3a0b2
    ...
    

    We don't have to setup any config file or else.

提交回复
热议问题