Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the reasons to use build scripts and continuous integration?

I'm trying to grasp the idea with build scripts, nightly builds and technologies like continuous integration, but I fail to see the advantages. Take this as an example:

We are a 4-person team developing an application, without unit tests. We also use Subversion for source control.

What benefits do we get by using custom build scripts and things like continuous integration? Do you "need" unit tests for this?

I can also mention that we develop on our local machines, and when the code is working we just update the svn checkout on the production server.

like image 923
alexn Avatar asked Dec 08 '22 07:12

alexn


2 Answers

If you don't have continuous integration you will need to wait until someone decides to do an integrated build to find out about conflicting or inconsistent commits. An integrated build is one that incorporates changes from all developers. If each developer is diligent about updating their local working copy then you might be able to get away without a regular integrated build, but really, why wouldn't you automate it?

A test suite will also help uncover changes to behaviour that break things but that do not necessarily cause an integrated build failure.

It is also standard practice to perform a smoke test on the fresh integrated build.

In addition to detecting conflicts and changes that break things, a nightly integrated build means you will always have a recent build that incorporates everyone's work to date. This is a boon for testing and demo purposes.

There's also some fun to be had in thinking up suitable punishments for whoever breaks the nightly build -- the implication is that they committed stuff without checking it was ok, so they should feel some pain in addition to resolving the build-breaking commit.

like image 161
Ed Guiness Avatar answered Dec 09 '22 21:12

Ed Guiness


Well, for a start it would be useful to have a repeatable build from a known environment. If you need to make a small change to a particular version (e.g. a customer is unwilling to move from version 1.5 even though you're now developing 3.2, but you could apply a patch to 1.5 on a branch) it really helps to be able to build easily.

It also means that as soon as you do start writing unit tests you'll derive even more benefit from them.

If you don't have any build scripts/servers at the moment, how do you build what you ship? Just on a random developer box?

Also see the answers to this related question.

like image 23
Jon Skeet Avatar answered Dec 09 '22 19:12

Jon Skeet