[Anthill-pro] Triggers + SVN - not working
Bell, Douglas
DBell at boingo.com
Thu Jun 14 15:35:03 CDT 2007
My triggers finally started working today after I restarted the
ah3server.... If all else fails reboot :/
- Doug
________________________________
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Curtis
Yanko
Sent: Thursday, June 14, 2007 12:07 PM
To: anthill-pro at caladin.urbancode.com
Subject: RE: [Anthill-pro] Triggers + SVN - not working
Here was a unix shell snippet that was shared on this list a while back.
Makes for much more manageable idiom IMO. Should be doable in Perl which
would make it cross-platform.
#!/bin/bash
TRIGGER_URL=https://anthill3.example.com/trigger
REPOS="$1"
REV="$2"
notify() {
wget --no-check-certificate "$TRIGGER_URL" \
--post-data="triggerId=$1&code=$2" -O /dev/null
}
checkpath() {
local path=$1
local id=$2
local code=$3
if svnlook changed "$REPOS" -r "$REV" | \
grep -E "^[[:print:]]+[[:space:]]+$path"
then
notify $id $code
fi
}
# path id code
checkpath ProjectA/trunk 31
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
checkpath ProjectA/branches/1.0 32
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
checkpath ProjectA/branches/2.0 33
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
checkpath ProjectB/trunk 34
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
- Curtis Yanko
United Health Technologies
Mail Route: CT028-06SA
Internet email: curt_yanko at uhc.com
Office 860.702.9059
Cell 860.729.8171
"Mikal Todd" <mtodd at bravurasolutions.com>
Sent by: anthill-pro-bounces at caladin.urbancode.com
06/13/2007 07:15 PM
Please respond to
anthill-pro at caladin.urbancode.com
To
<rws at urbancode.com>, <anthill-pro at caladin.urbancode.com>
cc
Subject
RE: [Anthill-pro] Triggers + SVN - not working
Ryan,
I've managed to get it working this morning, I have no idea why it has
started working - but can note the following which you can certainly
include in your docs.
- when using wget you will get files like trigger, trigger.1, trigger.2
downloaded with the options in the documentation. To attempt to
circumvent that I was using the option --spider which says in the
document it doesn't download anything. --spider DOES NOT WORK with AHP.
In order to avoid downloading spurious files in your SCM trigger use the
option '-O -' -- this says the output file is the console and does not
save anything. I've tested in win32 and unix.
- apparently wget must be 1.9+ for the --post-data command
- A windows script is below. This can be used in the doco if you wish. A
wget windows statically linked windows binary can be gotten from
http://users.ugent.be/~bpuype/wget/ and put in the c:\windows directory
or a path entry added to the script.
Post-commit.bat
--snip--
@ECHO OFF
svnlook changed d:\svn\artefacts %2 | FIND "trunk"
IF NOT ERRORLEVEL 1 wget -t 0 -O -
--post-data="triggerId=23&code=94f5145b7463f6ca7f3b3fe92f0da4e3a5b75a75"
http://servername/trigger
--snip--
Thanks,
Mike
-----Original Message-----
From: anthill-pro-bounces at lists.urbancode.com
[mailto:anthill-pro-bounces at lists.urbancode.com] On Behalf Of Ryan Smith
Sent: Thursday, 14 June 2007 1:12 a.m.
To: anthill-pro at lists.urbancode.com
Subject: Re: [Anthill-pro] Triggers + SVN - not working
Mikal,
Running the wget command manually, what do you get? Does it not trigger
the build when done this way? If you could send us the wget command at
support at urbancode.com and what version of wget you are using.
It will not be triggered by a browser hitting the URL since the request
must be a HTTP POST instead of a GET.
Below is our snippet for setting this up:
Configuring Subversion
In the post-commit hook script in your SVN repository, you add a check
to see that the changed information is on the path to your project. Then
you use a utility like wget to generate an http request to the URL
specified in the trigger.
if [ -n "$(svnlook changed /data/svn/mycompany/myproject -r $2 | grep
trunk)" ] then wget -t 0 https://server/trigger
--post-data='triggerId=31&code=95cde532437151c551cf062bf93c0d12de9209c7'
fi
If we wanted to change this script to target a branch of the project
instead of the trunk, we would change the script to be:
if [ -n "$(svnlook changed /data/svn/mycompany/myproject -r $2 | grep
branches/june_release)" ] then wget -t 0 https://server/trigger
--post-data='triggerId=31&code=cf062bf93c0d12d95cde532437151c551e123456'
fi
Ryan Smith
Mikal Todd wrote:
> I've spent about an hour attempting to get triggers to work and noted
> the earlier post by Doug Bell regarding triggers when it suggested a
> manual build and then try the triggers again.
>
> I have done the same as Doug, got the trigger setup, ran it with
> firefox/wget and still no build or anything in fact. Dead as a piece
> of driftwood.
>
> Tried deleting/changing triggers.. tried creating/changing them on
> different projects. Still no luck.
>
> I'm using AHP Version 3.2.1.b112
>
> Help!
>
> Thanks
>
> Mike
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
--
===========================================================
Ryan Smith. 2044 Euclid Ave., Suite 600
Lead Developer Cleveland, Ohio 44115
Urbancode, Inc.
email: rws at urbancode.com
web: www.urbancode.com phone: 216-858-9000
web: www.anthillpro.com fax: 216-858-9602
===========================================================
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.urbancode.com/pipermail/anthill-pro/attachments/20070614/6a6c2818/attachment-0003.htm
More information about the Anthill-pro
mailing list