How to retrieve subversion / git password in a script

I need to perform a SVN checkout directoy inside a powershell script
The detection of the repository modification is done by my build configuration (via the teamcity 'version control settings')
in the version control settings, we specify the account / password used by teamcity to check periodically if sources have changed

In my powershell script I need to specify the same account / password in order to retrieve the sources
I have seen that the account/password.
my question is : Is it possible to retrieve these information in my script via a variable, parameter or another way ?

Thank you!
Comment actions Permalink


There is no such property.
Usually TeamCity performs source checkout automatically. What problems have you met with this approach?


Comment actions Permalink

Thanks for your answer
we use the VCS detection of the modification proposed by teamcity,
but we use a custom script to checkout the sources

Why this approach ?
There is a problem with the proposed mechanism by teamcity (unless I'm mistaken):
the source of the build (the checkout source) cannot be customized
For the same project and/or config, we need to get se source for a central svn repository or
a another git repository, or from any other sources (like a zip file, a developper's source directory, etc)
this is something like a "personal pushed build", but with more flexibility
the solution we have found is to add a powershell step that receive, as input a generic url to fetch the sources


Comment actions Permalink

This is quite unusual workflow.
Are these sources of the same application? If not, then it will be much better to build them by different build configurations - each such build will have its own red/green status, history, and statistics.

TeamCity allows to run personal builds right from IDEs (IDEA, Eclipse, and Visual Studio) or by command-line tool. But again, working copies should relate to a common source repository.

May be I miss something in your use case. I appreciate if you explain it in more details.

Thank you

Comment actions Permalink

Hello, thanks for your answer
there are several reasons for this workflow

one of the reasons is that we are one svn global repository and 2 populations of developers : one use svn, the other use git as CVS client
if a dev that uses GIT want to push a personal solution to check to check that its work did not break anything, it cannot do that because no remote git repository exists

another reason, it that we don't want to have a very big svn repository, and we have historical svn repo and working repo. the historical repo contains the long history of the project
the working repo contains only a limited history (one or two years)
We want to have the possibility to get the sources from the old repo to recreate, rebuild, retest, any deployement files for any versions of this repo
in the future, the bigsvn  repo will be converted to git repo and we need to continue to have this possibility

Comment actions Permalink


it is not possible to change type of vcs roots on the fly. You should better create separate build configurations for svn and for git. It is possible though to change the url of repository you use. You can create configuation parameter repository.url with default value pointing to your new svn repo and put %repository.url% into the URL field in svn root settings. In this case of the builds will use new repository, but you can run custom builds that use changed value of %repository.url% that points to the old repository.

Comment actions Permalink

Ok! I'll try that
thanks a lot!


Please sign in to leave a comment.