tags:

views:

836

answers:

1

I have a project which is version-controlled using git.

What I want to be able to do is set up a repo on my (ssh-enabled) GoDaddy shared hosting package so that I can deploy with a push rather than dragging and dropping in FTP.

Any tips would be appreciated. Best would be an account from someone who's already done it, but I couldn't personally find any online.

(Cross-posted from serverfault as suggested.)

+2  A: 

Hello,

First, you will need to have git installed on GoDaddy. I'm not sure if this is possible. Git supports local user installs, but you need to have certain development tools handy to do it. Download git, and see if you can ./configure && make && make install -- if so, it will put it in your ~/bin directory.

We use git extensively for controlling production. But rather than deploying on push, may I suggest that you ssh to the box and do a git pull ?

More specifically, create a "Release" branch, and then when you are ready to deploy, simply merge your changes into the Release branch, ssh to the server, and git pull.

For example

ssh [email protected]
cd /path/to/project

#ok, assuming you are on the Release branch
git fetch
git merge branch-with-new-changes-on-it

# update the remote Release branch with the merge
git push origin HEAD

This simple workflow allows developers to see exactly what is on the production server at all times, and to merge other changes in with theirs before asking for a deployment. In fact, we require that all production changes be fully merged before requesting a deployment of your branch.

--

If you do manage to get git installed on GoDaddy, and you REALLY want to auto-deploy when you push to it, then take a look at the post-update hook.

http://www.kernel.org/pub/software/scm/git/docs/githooks.html

--

If you cannot get git installed on GoDaddy, then see if they support rsync. Then you can have a simple bash script somewhere that will

  1. pull your changes
  2. rsync them to godaddy

--

There are many ways to do it. Perhaps this will help with direction a bit...

gahooa