4

How do you deploy your websites?

For example: I am developing a site with a php framework and have it under version controle with git with all my local configs. When I want to put it on a web server for testing or updating the live application i have to copy it onto the server, change the config files, delete my test stuff etc.

So how do you handle these tasks? I thought about using ant and write a deployment script for this. Does there already exists a common solution for this "problem"? Because I don't think im the only one who need something like this.

peterh
  • 11,875
  • 18
  • 85
  • 108
soupdiver
  • 3,504
  • 9
  • 40
  • 68

2 Answers2

3

There are quite a bunch of stuff available, but you might like Phing (like ANT for java).

Questions related to PHP+Phing:

Do you use Phing?

How do you manage your build [using Phing] process?

Setting up a deployment / build / CI cycle for PHP projects

what can Phing do that Ant can't?

Also read this questions sounds very interesting How To Deploy Your PHP Applications Correctly?

There is a specific question (a possible duplicate of your questions) has been answered a while ago, take a look at it Deploy a project using Git push

Community
  • 1
  • 1
Rakesh Sankar
  • 9,337
  • 4
  • 41
  • 66
2

It seems you are using php, you should be good to go with capistrano. It is very easy to use capistrano for deployment with rails but it can also be tricked a bit to use for php.

Basically what you do with capistrano is -

  • Tell it which is you application server
  • Tell you database server
  • Tell web server (in most cases web server, app server and db server are same)
  • Specify you git repository with branch you want to deploy from

Once configured, you can deploy with capistrano with single command. You can even rollback your deployments from some of backup releases created by capistrano. Now form some the repetitive tasks like, copying configs files like database configs (which generally are ignored in git), you create some tasks, which just creates symlinks or copies the files at appropriate location. These tasks will be called with deploy_hookes e.g. after_symlink hook.

You can find more about capistrano here - https://github.com/capistrano/capistrano/wiki It comes with very good documentation, after getting overview, you may search for your framework specific approach to do this.

rtdp
  • 2,067
  • 1
  • 17
  • 32