Alex Rivera | Logout

How do you implement the "one step build" for a LAMP project?

Asked 2009-06-15T00:04:51.383
9

Having the "one push build" to take your changes from development environment to live server is one thing that is very nice to have and often advocated.

I came on board with a small team running in a LAMP stack and use SVN for version control, currently deployed on a single production server (another server for development and soon to be a separate mysql server). I'm just now putting in place a lot of the organizational things that have been missing prior to me coming on board.

I am curious to see

  1. how people are doing this (one step build) currently
  2. see how i can implement it best for my situation (small team, LAMP environment with SVN)

Some particular challenges I'm interested in would be handling database changes (schema) and also if and what kind of "packages" are people using to keep things organized (e.g. RPMs, PEAR, etc.).

Edit
Report

3 Answers

7

We used ant with Hudson. Worked like a charm.

Hudson would work with other build systems too, and not just java projects. It lets you setup multiple build targets, and will run them automatically, or manually. It also forces you to implement a way to run your build from a single command.

It doesn't solve the communication problems where the server will be unavailable during the time it takes to run the build for the deployed server.

For our schema updates and changes, we setup our ant script to do two things:

  1. Update run the schema only if there's a difference in SVN.
  2. Check in a schema dump after the schema changes were built.
  3. If there was no update to the schema, simply use the dump to load a database

It did take a few tries to get right, but suddenly we had solved the issue of multiple developers being on different schemas. It was so easy to import the dump to update your development schema, that you could do it daily.

answered 2009-06-15T00:09:16.350
2

We do. We use a product called Anthill Pro to do all of our builds and deployments. It has a workflow process which set up to check out the files, do the builds, run the unit tests and then deploy the code to the servers. You can use it to deploy just about anything as the process can run command line programs etc.

answered 2009-06-15T00:18:24.767
0

The way I think of it is that you want one script to pull everything together, basically get all the files\resources from source control an the perform all the steps to create a final 'product'

Off the top of my head those step could include get latest, compile, get any other files need to complete the product, create installer (if needed), run unit tests, share output on server (whatever that might mean for a particular project), and inform users that a new version has been create (or tell them if one has not, and why). And whatever else you might need to do.

In the past I've usually started with some sort of batch file, then created some sort customized builder exe. But maintaining that always became a pain. Eventually I move one to 3rd party applications...now I just use one of the two products below.

http://www.kinook.com/VBP/

http://www.finalbuilder.com/

answered 2009-06-15T03:15:55.417

Your Answer