I have heard this complaint a lot, and even at my company.It's just a way of working. If you're not capable of having your stuff compilable and testable at all times, you're probably working on your problems in an erratic way, and are touching too much code at once. You're a juggler. Jugglers don't program.
On all my projects, we do HOURLY builds. We use Luntbuild to do that, and it will mail all project members as soon as the build fails, and will keep on mailing until the build works. Broken code does not get checked in, and when somebody breaks the build, he has to get cookies for the whole team (or other fitting "humiliation" :-) ).
Each week we try to do an installation of the software on our testservers, so that our test department can test the software.
You will see that this will result in better code, and a shippable project at almost any time during the project because:
- You are forced to break down your work in smaller, easier to grok and therefore easier to code pieces, which will result in less bugs.
- You are forced to update and check in often, which makes the project go faster because you benefit from reuse of your collegues earlier in the project.
- The code will be cleaner because you want to be able to write a unittest for it (otherwise the "coverage police" will get you)
I realize that this is not a real answer to the "how do you keep the builds working" question, I think there is not a really silver bullet answer for that. You just have to start doing it and see if it works for you. I think the larger part of the professional programmers agree that continuous integration, automated testing and daily builds are a goog thing.
My current project has 2 problems, one being that the buildserver does not mail due to a network problem, and the other being that there is too much panic. This means that failin hourly builds are noticed much later, and weekly installations are not possible because of unfinished functionality. You can immediately see reflections of this problem to the project, and the motivation of team members. It's just not going "smoothly".
I hope this helps. Keep them green! (the unittests, that is)
edit: The "pressing the button" you are refering to is the "single step build". It means that you have a script which does your build (or ant, or maven, or whatever), and you use that script to do the tests aswel. So when your automated buildprocess works, you know you have a shippable product. You just run the script and send the output to the customer. Our build script produce a directory structure which gets copied 1-on-1 to the CD we deliver the software with.