如何以编程方式访问当前的Heroku版本? [英] How do I access the current Heroku release version programmatically?

查看:116
本文介绍了如何以编程方式访问当前的Heroku版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是否有可能-是否存在像RELEASE_VERSION这样的环境变量?

Is this even possible - is there something like a RELEASE_VERSION environment variable?

推荐答案

现在有一个名为 Heroku Labs 的已发布功能.为您提供此信息的 Dyno元数据.一旦启用它,您正在运行的dyno的环境将包含环境变量,应用程序的Heroku版本ID,用于构建发行版本的git commit哈希,等等.例如:

There is now a released Heroku Labs feature called Dyno Metadata that gives you this information. Once you enable it, your running dyno's environment will contain environment variables with the Heroku version ID of your app, the git commit hash from which your release slug was built, and much more. For example:

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

这篇关于如何以编程方式访问当前的Heroku版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆