Reputation: 1185
I have more than 10 different Ruby on Rails apps where I have to deploy the same code. I have connected the git repo to my Heroku apps, so whenever I push new changes it deploys on all of them.
The issue is with the database migration step. I want to run migrations automatically after each deployment. None of custom build pack is working. Can someone please help me? I am using rails 4 and spree.
So far, I have tried:
This solution is not working.
Is there any other solution to run Rails migrations on Heroku automatically?
Upvotes: 5
Views: 1720
Reputation: 581
No need to use gems or write scripts. Heroku has a 'release' phase features (https://devcenter.heroku.com/articles/release-phase).
Thank to this, you just have to add to your Procfile
some code to automatically run rails db:migrate
to all your push:
# cat Procfile
release: bundle exec rails db:migrate
Upvotes: 15
Reputation: 665
You can use Travis-ci. Pretty simple to setup and provides the desired functionality
Upvotes: 1
Reputation: 2183
Add gem 'iconv', '~> 1.0.3'
to your gemfile and then try it will work as worked for me!
I take this as a duplicate of this answer
If you are looking for alternative then you can write a deploy script in .sh file and run it everytime like bash script.
Upvotes: -1