How can I clear rails cache after deploy to heroku?

前端 未结 7 1980
暖寄归人
暖寄归人 2020-12-13 13:21

I applied cache to my heroku rails app and it works well. But everytime I deploy to heroku, I also want to clear cache automatically.

so I googled and I found this

相关标签:
7条回答
  • 2020-12-13 14:05

    If you want to simply run a rake task after deploy, I would recommend checking out:

    https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks

    We've been using it in production for over 6 months and it's been rock solid.

    First, add the buildpack AFTER you already have the Ruby buildpack set. This should happen after your first deploy to the server

    heroku buildpacks:add https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks

    Second, set an environment variable called DEPLOY_TASKS with just the names of the rake tasks you want to run separated by spaces.

    heroku config:set DEPLOY_TASKS='cache:clear

    0 讨论(0)
提交回复
热议问题