0

We are running CentOS 5.6 on a dedicated server. I am planning on deploying our Magento store changes using BeanstalkApp (www.beanstalkapp.com) which offers pre and post deploy hooks.

My username for the server is (in this example) USER123 but the files need to be owned by APACHE for Magento to run correctly. This is the advice of my server host.

What I am trying to achieve is to automatically run the following command on the server before a deploy:

sudo chown -r USER123: /var/www/vhosts/domainname.com/httpdocs/store/

followed by the following after the deploy:

sudo chown -r APACHE: /var/www/vhosts/domainname.com/httpdocs/store/

So I have two questions:

1) Will the above commands work, or do I need to switch into the directory shown and then use ././ instead of the exact route shown above?

2) How do I make this into a 'script' that can be touched by BeanstalkApp pre and post deploy?

Any pointers would be appreciated!

1 Answer 1

2

You will need to use a -R rather than the -r shown in your example. other than that you should be good to go.

To make script then using your favourite editor create a file like this

#!/bin/bash
sudo chown -R USER123: /var/www/vhosts/domainname.com/httpdocs/store/

save the file as e.g. predeploy then set the permissions as 755

chmod 755 predeploy

Do the same with your postdeploy script. How you hook them into beanstalk I can't help with though

3
  • Is there a way of making this bash file execute when touched? i.e. when I visit domainname.com/deploy/predeploy is runs the predeploy file?
    – dannymcc
    Jun 16, 2011 at 9:50
  • Surely you would use the pre and post deploy hooks provided by beanstalk to do this?
    – user9517
    Jun 16, 2011 at 14:44
  • I was under the impression that a hook simply requests a URL of my choice?
    – dannymcc
    Jun 16, 2011 at 14:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .