How to set a svn address
Opened this issue · 8 comments
How to set a svn address in Godeps file.
and set a username for svn login.
Please give some demo, thanks!
Hey @dingoxiong ! It really depends on where the svn repo is hosted, is it GitHub? or which service?
In the Godeps file you would just add the go-style import path as you would normally, GitHub supports a way of authentication for private repos that Git honors (and svn probably does as well) but this is really up to each hosting provider.
Thanks
if it does work with your setup, could you post confirmation here? I'd be good to add to the documentation. :)
I still not find the right way. My svn repo is Apache Subversion.
@dingoxiong right, you're using svn, but this depends on how the provider handles authentication so while we might be able to find a way we need to know which service you're using: for example, right now the provider with which we know how to handle private repos is GitHub, where is your svn repo hosted?
My repo is hosted in local network of my company.
A Subversion repo, with http://ip/path, and we need username and password.
Well, the bad part is that I can't find anyone succeeding with a private svn repo use case by looking it up on the internet, the good part is that if you control the subversion server there is bound to be a way of doing it.
From The SVN Book
Command-line authentication
All Subversion command-line operations accept the --username and --password options, which allow you to specify your username and password, respectively, so that Subversion isn't forced to prompt you for that information. This is especially handy if you need to invoke Subversion from a script and cannot rely on Subversion being able to locate valid cached credentials for you. These options are also helpful when Subversion has already cached authentication credentials for you, but you know they aren't the ones you want it to use. Perhaps several system users share a login to the system, but each have distinct Subversion identities. You can omit the --password option from this pair if you wish Subversion to use only the provided username, but still prompt you for that username's password.
Authentication wrap-up
One last word about svn's authentication behavior, specifically regarding the --username and --password options. Many client subcommands accept these options, but it is important to understand that using these options does not automatically send credentials to the server. As discussed earlier, the server “pulls” credentials from the client when it deems necessary; the client cannot “push” them at will. If a username and/or password are passed as options, they will be presented to the server only if the server requests them. These options are typically used to authenticate as a different user than Subversion would have chosen by default (such as your system login name) or when trying to avoid interactive prompting (such as when calling svn from a script).
I have almost no experience with svn, but It seems it provides a way to authenticate against a remote server, not only that: it also caches that authentication so it happens transparently on subsequent commands. I think you should be able to fetch the repo in a machine by using the --username
option on your svn command (if that's already configured on the server, if not you'll have to set it up), once the credentials are cached locally then you might be able to run go get <your private package>
, if you can run go get with it, then gpm will support it (since that's the same thing gpm does) and you'll be good to go.
There are quite a few ifs in that paragraph though, and unfortunately it seems there aren't a huge lot of svn-golang users out there sharing their experience with these problems, so if this approach leads nowhere then things look a bit grim for you. If everything else fails I would suggest you vendor the external package inside your repo, it's a dirty solution, but it gets the job done.
Good luck!
Thanks a lot!