Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi,
I have a rails server running in my Ubuntu 14.04 instance and I host my code in github.com. For user’s pushing to github, I have setup a webhook to my app which listens to any POST call from github and tries to execute a ruby script gitscript.rb when the POST has all correct payloads.
Unfortunaltely the script doesn’t do a git pull and I am stumped to run this perfectly. Any help would be appreciated.
Below is my code to listen to webhooks and it runs the script, but the commands in the script don’t run, I have all the permission required for the ruby script.
def webhooks
push = JSON.parse(request.body.read)
if some_condition_that_should_be_true
logger.info "Yes go ahead and pull"
logger.info "Ran the git pull command" if `cd /home/server && git pull >> cat.txt`
logger.info "Ran the ruby" if `ruby /home/server/gitscript.rb`
logger.info "Last command"
else
logger.info push
end
render :json => { :code => 'Webhooks came good' }, :status => 200
end
And my ruby script is below and yes it has all permissions correct, for test sake I made them 777
#!/bin/env ruby
`cd /home/server && git pull`