[Anthill-pro] Triggers + SVN - not working

Mikal Todd mtodd at bravurasolutions.com
Wed Jun 13 18:15:09 CDT 2007


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


More information about the Anthill-pro mailing list