Reputation: 3314
If a ruby app is running on Heroku, is it possible to pull changes from Github and run a rake task? I've added some code to call exec git pull
when an endpoint is requested, however the Heroku logs just tell me that the "App has crashed". Perhaps Heroku doesn't allow apps to do this?
Here is my setup:
What I'm attempting to do is expose an endpoint via Sinatra to run the following process:
git pull
and rake generate
Upvotes: 1
Views: 234
Reputation: 22238
You won't be able to do this because the application you have running on a dyno and the Git repo are two different things.
When you push to Heroku, you're pushing into Git. This repo is then used to generate a 'slug' which is then deployed to dynos. This slug contains your application and all it's dependencies, not the entire git repo.
Therefore, running any Git commands from your application code will not work.
Upvotes: 3
Reputation: 11596
There might be some other reasons too but you can't do a pull because the filesystem of your app is read-only so you can't add any new files to it.
Upvotes: 1