Alex
Alex

Reputation: 12019

auto deploy php to multiple machines with git

I have 40 servers spread world-wide. All running centos lamp.
I'm using git and I want every change to production branch to be deployed to each of those machines. Each machine has it's own config.php and few other machine specific files.

Currently commits to production branch trigger hudson build task with phing running phpunit tests, php-md, cpd and etc. The question is, how to deploy it to each of my machines, preferably with running selenium tests on/for each of the updated servers, prior to making it live.

I've looked into capistrano, but I totally don't want to mix ruby and add this dependencies in my team.

Your suggestions for php multi server CI deployment ?

Variant 1

As an option, run a web-hook on commit, launching phing build on each of the machines, where in the build configuration I'll specify which repo to clone, which files to leave at place and which to replace.
Although this would fail if I suddenly push a bugged build.xml file which will prevent me from rebuilding / reverting without 40 manual interruptions. + no reverting option.

Upvotes: 0

Views: 434

Answers (3)

coderofsalvation
coderofsalvation

Reputation: 1803

Well, If you want to deploy to servers you can use a service like deployhq.com, or if you prefer to do it yourself take look at deployogi. Its based on bash and deployogi-hooks, and these hooks can be phpscripts (or whatever has mode 755).

Upvotes: 0

Alex
Alex

Reputation: 12019

Ended up with a bit customized git flow, where a post-receive hook triggered build scripts via and CI server. The build result was placed in a folder that was lately synched with rsync to all those 40 servers.

The config.php for each server had been left in the git repo itself
and php's auto_perpend_file directive was set in the vhost config to load the correct config.php file for the current server.

Upvotes: 1

Abs
Abs

Reputation: 57916

If you are currently using Phing, you can simply use Jenkins to poll your repository for changes every few minutes and then start a deployment using Phing.

I'm assuming your build script is uploading the files to each of your environment with the right config files.

Upvotes: 0

Related Questions