Re: ant not working with CC

Adam Bruss <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <[email protected]>
Try this
...
                <target name="checkout">
                        <exec executable="svn" dir="/home/vhosts/projects/nhcc/nhcc/">
                          <arg line="update" />
                         <arg line="-username myusername"/>
                        <arg line="-password mypassword"/>
                        </exec>
                </target>
...

where myusernmame is the svn username and mypassword is the svn password. Cruisecontrol runs under a different user so it's using credentials other than what is used when you the ant script manually.

Adam Bruss
Senior Development Engineer
AWR Corporation
11520 N. Port Washington Rd., Suite 201
Mequon, WI  53092  USA
P: 1.262.240.0291 x104
F: 1.262.240.0294
E: [email protected]
W: http://www.awrcorp.com<http://www.awrcorp.com/>

From: Bal Krishna Shrestha [mailto:[email protected]]
Sent: Tuesday, June 14, 2011 10:43 PM
To: [email protected]
Cc: 'Dan Rollo'
Subject: [Cruisecontrol-user] ant not working with CC

Hi All,

Here is my build.xml file in /home/vhosts/build/nhcc_nhcc
<?xml version="1.0" encoding="UTF-8"?>
        <project name="nhcc_nhcc_01" basedir=".">
         <target name="build" depends="checkout,php-documentor,phpunit,php-codesniffer" />
                <target name="checkout">
                        <exec executable="svn" dir="/home/vhosts/projects/nhcc/nhcc/">
                          <arg line="update" />
                        </exec>
                </target>
         <target name="php-documentor">
          <exec executable="phpdoc" dir="/home/vhosts/projects/nhcc/nhcc">
           <arg line="-ct type -ue on -t ${basedir}/build/api
                 -tb /usr/share/php/data/phpUnderControl/data/phpdoc
                 -o HTML:Phpuc:phpuc -d ."/>
          </exec>
         </target>
        <target name="phpunit">
          <exec executable="phpunit" dir="/home/vhosts/projects/nhcc/nhcc" failonerror="off">
            <arg line="--log-xml ${basedir}/build/logs/phpunit.xml
                  --log-pmd ${basedir}/build/logs/phpunit.pmd.xml
                  --log-metrics ${basedir}/build/logs/phpunit.metrics.xml
                  --coverage-xml ${basedir}/build/logs/phpunit.coverage.xml
                  --coverage-html ${basedir}/build/coverage
                  CalculatorTest.php" />
          </exec>
        </target>
         <target name="php-codesniffer">
         <exec executable="phpcs"
             dir="/home/vhosts/projects/nhcc/nhcc"
             output="${basedir}/build/logs/checkstyle.xml">
            <arg line="--report=checkstyle
                  --standard=PEAR
              ."/>
          </exec>
        </target>
 </project>


Here is my config.xml file in /opt/cruisebin284/
<project name="nhcc_nhcc_01" buildafterfailed="false">
                 <plugin name="svn" classname="net.sourceforge.cruisecontrol.sourcecontrols.SVN" />
                 <modificationset quietperiod="60">
                        <svn localWorkingCopy="/home/vhosts/projects/nhcc/nhcc/"/>
                </modificationset>
                 <schedule interval="60">
                            <ant anthome="apache-ant-1.7.0" buildfile="/home/vhosts/build/nhcc_nhcc/build.xml"/>
                </schedule>
                 <listeners>
                          <currentbuildstatuslistener file="logs/nhcc_nhcc_01/status.txt"/>
                </listeners>
                 <log dir="logs/nhcc_nhcc_01">
                          <merge dir="/home/vhosts/build/nhcc_nhcc/build/logs/"/>
                </log>
                 <publishers>
                          <artifactspublisher dir="/home/vhosts/build/nhcc_nhcc/build/api"
                            dest="artifacts/nhcc_nhcc_01"
                            subdirectory="api"/>
                          <artifactspublisher dir="/home/vhosts/build/nhcc_nhcc/build/coverage"
                            dest="artifacts/nhcc_nhcc_01"
                            subdirectory="coverage"/>
                          <execute command="phpuc graph logs/nhcc_nhcc_01
                            artifacts/nhcc_nhcc_01"/>
                 </publishers>
 </project>


My problem is that ant is not working in CC config.xml to checkout the svn project

when i ran the following command in /home/vhosts/build/nhcc_nhcc
                #/opt/cruisebin284/apache-ant-1.7.0/bin/ant checkout
it is working well

why not working this from CC????
Is there any mistake in config.xml or build.xml file????


Also i add script to run ant to checkout in script it contain following main line
                /opt/cruisebin284/apache-ant-1.7.0/bin/ant checkout

when i run this script from command prompt (/script/ant.sh) it working fine but running same script from cron job (*/5  *  *  *  *  root    /script/ant.sh) it give following error
Error code as:

                Buildfile: build.xml

                checkout:
                 [exec] Authentication realm: <http://svnadmin.devhwbnepal.com:80> SVN_Admin
                 [exec] Password for 'root': Authentication realm: <http://svnadmin.devhwbnepal.com:80> SVN_Admin
                 [exec] Username: svn: PROPFIND request failed on '/svn/nhcc_nhcc_01/trunk'
                 [exec] svn: PROPFIND of '/svn/nhcc_nhcc_01/trunk': authorization failed (http://svnadmin.devhwbnepal.com)

                BUILD SUCCESSFUL
                Total time: 0 seconds


Please help me what is mistake in my code in both build.xml and config.xml file as well as why not working script from cron job

Thanks ,


Regards,
Bal Krishna Shrestha

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.