简体   繁体   中英

Heroku seed database with data not in seed.rb

I have a Rails app and an AppKeys table. The AppKeys tables hold some configuration data that I do not want to expose. Currently, after pushing to Heroku, I need to run heroku run rails console and manually add the configuration data into the database.

I do not want to put the config data in seed.rb since the project is on Github.

I want to run git push heroku master and have it automatically seed the AppKeys table from a local ignored file.

Is there a way to automate this?

Looks like you're looking for release phase .

If you set a release process type in your Procfile, it will be used for every new release (deploys, config vars changes, ...) to run a one-off dyno with that command.
The new release won't be used until that command succeeds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM