在Heroku部署之后做些事情 [英] Do something after Heroku deployment
问题描述
具体来说,我们想要构建出一个钩子或事件,以便在Rails应用程序部署到Heroku后立即触发事件在tmp /下的某个目录结构(该结构取决于配置值,因此无法检入到源代码中)。
Heroku在部署钩子后支持一些功能 - 请参阅 https://devcenter.heroku.com/articles/deploy - 挂钩。
您可以使用HTTP挂钩在您的应用上触发一个操作,这将创建您想要的结构。作为如何使用此HTTP部署挂钩的示例,请查看 http://dzello.com/blog/2012/03/11/spin-up-your-heroku-dyno-automatically-after-deploy/
请记住,如果您在 tmp
目录中创建任何内容,它将在dyno重新启动后消失。
Is there a hook or event that can be used in order to trigger something immediately after a Rails app is deployed to Heroku?
Specifically, we want to build out a certain directory structure under tmp/ (the structure is contingent on config values so it can't be checked into source).
Heroku supports a few after deploy hooks - see https://devcenter.heroku.com/articles/deploy-hooks . You can use the HTTP hook to trigger an action on your app which will create your desired structure. As an example of how to use this HTTP deploy hook, check out http://dzello.com/blog/2012/03/11/spin-up-your-heroku-dyno-automatically-after-deploy/
Keep in mind though that if you build anything in the tmp
directory, it'll go away after a dyno restart.
这篇关于在Heroku部署之后做些事情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!