Reflecting Heroku push version within the app

后端 未结 9 812
故里飘歌
故里飘歌 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 10:13

    I am using Codeship so I plan on just adding this to the push config:

    heroku config:add HEROKU_RELEASE_VERSION=$(heroku releases | head -2 | awk 'NR==2' | awk '{print $1}')

    Note that the other similar answer is invalid since it is grabbing some of the later versions (it uses tail instead of head) and it tries to set it to two versions instead of just one (ie: v100 \n v101).

提交回复
热议问题