Re: Perlish alternative to CruiseControl (automated builds)?
by jettero (Monsignor) on May 27, 2008 at 16:54 UTC
|
The first thing that comes to mind is to just have a cron task that runs make on my Makefile. However, how can I programmatically detect if the build fails and jump to my send_email script?
Dunno about yours, but my cron tends to email me every time something exits with a non-zero exit status. GNU Make would be among the programs that exits with meaningful status.
Other than cron, I'd look at the new and exciting IPC::System::Simple, possibly combined with Net::SMTP::OneLiner. Suddenly it seems like a four line program to me.
| [reply] |
|
Ah, of course. make exits with its own non-zero status if one of the commands it runs exits with a non-zero status. And thus, cron would -- as expected -- send an email.
So, it looks like all I'd need to do to get a web interface at that point would be: write a CGI script to check for new email and go from there.
Thanks!
| [reply] |
|
| [reply] |
Re: Perlish alternative to CruiseControl (automated builds)?
by petdance (Parson) on May 27, 2008 at 22:38 UTC
|
You're looking for Smolder:
| [reply] |
Re: Perlish alternative to CruiseControl (automated builds)?
by dragonchild (Archbishop) on May 27, 2008 at 18:42 UTC
|
Generally, you cron the script that does that sort of detection. So, if there's any decisions to be made, you have to write the script ot make that decision. cron just runs the thing.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
| [reply] |
|
| [reply] |
|
Uh, no. Write a script that does everything (run make, check email, etc). Cron that.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
| [reply] |
|
Re: Perlish alternative to CruiseControl (automated builds)?
by mhearse (Chaplain) on May 27, 2008 at 23:47 UTC
|
#!/bin/bash
#assume we call this program /bin/cruise_control
error_file=/tmp/make.$$
cd /your/project/path
make ${ARGS} 2> $error_file || {
cat $error_file | /bin/mail -s "project build error" you@yout.com
}
Run from cron on a detached screen. Which means you can join the screen (screen -r cruise_control) if you ever want to watch the build process. Otherwise the screen exits when the build is finished.
01 * * * Mon-Fri root /usr/bin/screen -mdS cruise_control /bin/cruise_
+control
| [reply] [d/l] [select] |
Re: Perlish alternative to CruiseControl (automated builds)?
by jdporter (Paladin) on May 27, 2008 at 18:35 UTC
|
| [reply] |
|
| [reply] |
Re: Perlish alternative to CruiseControl (automated builds)?
by Mutant (Priest) on May 28, 2008 at 09:26 UTC
|
There's no reason why you can't use CruiseControl for Perl (or Hudson, which seems to be gaining popularity, or AnthillPro, which we're currently rolling out at work, which does a *lot* more than CI, but isn't free).
These things tend to work by running executables, and parsing particular types of outputs, usually Maven or Ant for build in the Java world, and jUnit for tests. But they're pretty extensible, so you can use them with make and TAP with some minor scripting. There is Smolder, as has already been metioned, if you need it to be Perl.
| [reply] |
|
Not to be harsh, but, from my perspective, any XML-based build description language/tool is crippleware by design. The ant-contrib project rescued ant slightly, but the whole concept of incorporating control flow into XML I have judged, by experience, to be awful.
| [reply] |
|
You're talking about Ant / Maven? As I said, you don't have to use those. CI tools are a completely different beast. AnthillPro is configured via GUI (and backed by a RDBMS). AnthillPro is nothing to do with Ant.
| [reply] |