Project

General

Profile

Update a project's repository from modified reposman.rb

Added by Seb Paris almost 13 years ago

Hi there,

We are trying to modify reposman.rb in order to automatically create a repository based on the given URL in the forge.
The goal is to analyse each project's repos url, and for those which match a regexp '{repo}://auto' to create the corresponding {repo} (svn, git, cvs) and to update the project's configuration accordingly.

We where able to perform everything, but the repository modification using the following:

project.post(:repository, :vendor => $scm, :repository => {:url => "#{$svn_url}#{project.identifier}"}, :key => $api_key)

This fails with a 409 Conflict error.
Indeed, the repository resource already exist for an 'auto' project as we must configure its url.

So we tried naively this:

project.*put*(:repository, :vendor => $scm, :repository => {:url => "#{$svn_url}#{project.identifier}"}, :key => $api_key)

This time failing with a 405 Method not allowed error.

Some my question are:
1. is there a way to modify the repository configuration using this kind of method?
2. if not, is there a way to destroy a project's repository in reposman.rb (so we could use the standard creation method with a push)

Sorry if my question looks naive or not precise, but I must admit that I never developped with ruby so I'm getting a little lost :)


Replies (1)

RE: Update a project's repository from modified reposman.rb - Added by Seb Paris almost 13 years ago

Ok, apparently no way to edit a post, so sorry for the bad English :/

    (1-1/1)