You will need to run that API for each repo, separately. You can build the script using curl commands in Excel. You'll run 1000+ curl commands, but since it's basically a one time loading it should be fine.
Below is the cUrl command i'll be using to add repo. Can you check if the below command will work? Is the type(attribute) is case sensitive?
curl -u XXXXX:XXXX -X POST --data '{"type":"SUBVERSION","name":"<display_name>","url":"<svn_ul>","path":"<path if exit>","username":"<user_name>"}' -H "Content-Type: application/json" http://crucble.mspot.com/rest-service-fecru/admin/repositories-v1/
Also can you confirm if we can add 1000+ commands like this in Shell script and execute? Will this add all the repos?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, running that command separately, for each repo, will work.
Type will be case sensitive. I would suggest running these one at a time until you know it works, and only then should you run the rest of the 1000+.
You'll have to look closely at the example data payload in the API document (linked earlier):
{
"type" : "svn",
"name" : "mySvnRepo",
"description" : "My SVN repo",
"storeDiff" : true,
"enabled" : true,
"svn" : {
"url" : "svn://svn.mycompany.com/myrepo",
"path" : "/amazingapp",
"auth" : {
"username" : "copernicus",
"password" : "sun123"
},
"blockSize" : 400,
"commandTimeout" : "1 hour",
"connectionsPerSecond" : 1.0,
"charset" : "UTF-8",
"accessCode" : "allow",
"startRevision" : 10000,
"initialImport" : "notags",
"followBase" : true,
"usingBuiltinSymbolicRules" : false,
"trunks" : [ {
"regex" : "trunk(/|$)",
"name" : "trunk"
}, {
"regex" : "core/trunk(/|$)",
"name" : "trunk",
"logicalPathPrefix" : "core"
} ],
"branches" : [ {
"regex" : "branches/([^/]+)",
"name" : "${1}"
}, {
"regex" : "core/branches/([^/]+)",
"name" : "core-${1}",
"logicalPathPrefix" : "core"
} ],
"tags" : [ {
"regex" : "(tags|releases)/([^/]+)",
"name" : "${2}"
}, {
"regex" : "core/tags/([^/]+)",
"name" : "core-${1}",
"logicalPathPrefix" : "core"
} ]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Josh Steckler Do I have to provide all the information after user_name & pass_wd mentioned above? Or the cRul command I mentioned will work? Can the username and password be same for all repositories? B/C I am an admin, so I am using my credentials. Will there be a problem if user try to access the repo?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not everything here is required, but remember you may be using two different usernames/passwords here.
In the curl -u username:password you're giving your fisheye user credentials
In the Json you're giving SVN credentials
I'm not exactly sure which fields are required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Josh StecklerThis I already checked but it does not show up the how can I add multiple repositories at once. For example we have two repo (display name: Y, X) these are SVN repository and SVN URL for both are different. So how can I achieve this and add these two REPOSITORIES using POST method?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.