[CMake] using svn credentials inside ctest script

David Cole david.cole at kitware.com
Fri Jan 28 06:22:37 EST 2011


Storing credentials on the machine in advance is one way to achieve this.

(I have not tried this myself, but...) You may also be able to set the
CTEST_UPDATE_COMMAND to a script that delegates to svn with all your desired
command line options.

The output of the script must be svn output -- ctest parses the output
directly to detect modified files.

The upating commands of ctest were re-factored in the relatively recent past
to enable git, hg and bzr updates. You may need different techniques with
different versions of ctest.

The best way to approach this is probably to look at the ctest source code
and figure out exactly what it's doing in your case, and why it doesn't
work. Certainly, what you're trying to do is reasonable. Although one could
argue it might be better to cache credentials on machines than save them in
plain text in a script file.....


HTH,
David


On Fri, Jan 28, 2011 at 3:15 AM, girish hilage <girish_hilage at yahoo.com>wrote:

> Yes. I tried giving OPTIONS directly with CTEST_UPDATE_COMMAND but it says
> "Update command failed".
>
> If I execute "svn update --username <my_svn_username> --password
> <my_svn_password> --non-interactive" from a simple shell script (.sh
> file),
>
> then it works fine without prompting for a password.
>
> Does that mean 'svn update' with svn credentials do not work as expected in
> the ctest script?
> Is, first storing the SVN credentials on a machine executing the cronjob,
> the only solution?
>
> Regards,
> Girish
>
> --- On *Thu, 1/27/11, Tyler Roscoe <tyler at cryptio.net>* wrote:
>
>
> From: Tyler Roscoe <tyler at cryptio.net>
> Subject: Re: [CMake] using svn credentials inside ctest script
> To: "girish hilage" <girish_hilage at yahoo.com>
> Cc: cmake at cmake.org
> Date: Thursday, January 27, 2011, 4:42 PM
>
>
> On Thu, Jan 27, 2011 at 08:40:14AM -0800, Tyler Roscoe wrote:
> > On Thu, Jan 27, 2011 at 04:11:35AM -0800, girish hilage wrote:
> > >    find_program(CTEST_SVN_COMMAND NAMES svn)
> > >    set(CTEST_UPDATE_COMMAND "${CTEST_SVN_COMMAND}")
> > >    set(CTEST_UPDATE_OPTIONS "--username <my_svn_username> --password
> <my_svn_password>")
> > >
> > >    ctest_update(RETURN_VALUE updateRV)
> > >
> > >    But, when I give 'ctest -S script.cmake', it again asks for the svn
> password eventhough I have hard-coded svn username and password in
> script.cmake.
> > >    My requirement is that, I am setting up a cronjob for nightly builds
> and I do not want it to ask for an svn password.
> > >
> > >    In the output I can see following lines :
> > >
> SetCTestConfigurationFromCMakeVariable:UpdateCommand:CTEST_UPDATE_COMMANDSetCTestConfiguration:UpdateCommand:/usr/bin/svn
> > >
> SetCTestConfigurationFromCMakeVariable:UpdateOptions:CTEST_UPDATE_OPTIONSSetCTestConfiguration:UpdateOptions:--username
> <my_svn_username> --password <my_svn_password>
> > >
> SetCTestConfigurationFromCMakeVariable:SVNCommand:CTEST_SVN_COMMANDSetCTestConfiguration:SVNCommand:/usr/bin/svn
> >
> > Your code looks reasonable to me. Have you tried sticking the OPTIONS
> > directly into CTEST_UPDATE_COMMAND?
> >
> > You could also let Subversion handle the username/password; it will
> > cache them if ask it to. The advantage is that you don't have to
> > hardcode passwords into your build scripts. The disadvantage is this is
> > something you'll need to take care of for all machines/accounts that do
> > automated builds.
>
> One other thing that I had to discover myself and which I haven't
> noticed in any CTest documentation:
>
> # 'update' and '--non-interactive' are automatically added to
> # CTEST_UPDATE_COMMAND by CTest.
>
> So maybe --non-interactive is interfering with --username/--password? It
> shouldn't but it's another thing to test.
>
> tyler
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110128/fe781abc/attachment-0001.htm>


More information about the CMake mailing list