Access current git commit number from within Heroku app

前端 未结 3 1198
一向
一向 2021-01-14 03:55

I know the slug compiler removes the .git directory when creating a heroku slug, but is there any way to configure Heroku so that I can access the currently run

3条回答
  •  无人及你
    2021-01-14 04:12

    You can run a script before deploy that store this information (maybe on a YAML)

    using these a = `ls` (note that is not ' "apostrophe" sign is ` "inverse accute" sign)
    the a variable will have the result of this bash command,
    so you can do git = `git log` and then find the information you want it and store it. So you will be able to retrieve it later.

    Did this helped ?

提交回复
热议问题