Using gitosis to configure repositories works quite well.
However, manually creating every repository is quite cumbersome, especially as it has to be done on command line. (git init, git remote add, git commit, git push) As the majority of our projects are OSGi-Bundles, we can use almost the same repository layout and pom-file for each project. So instead of creating all this every time we have to create a new bundle i'd like to do something like this:
Is there already a solution/common way to solve step 4? I'm currently thinking on using a git-hook to detect repository configuration. However, it seems that is may be necessary to parse the gitosis.conf file every time post-update is called.
Ideally, I'd like to use some git information to fill the pom.xml file (Repository-Name as artifactID, repository description as artifact description, etc..)
Is there a more convenient/robust way to get information about configured but not yet created repositories?
You could create a template repository somewhere that looks like this:
$ ls -A
.gitignore
pom.xml
src/.gitignore
setup-remote
Then your workflow for new repositories looks like this:
Developer clones the template repository:
$ git clone .../template.git my-new-repo
Developer runs the setup-remote
script to configure access to the
actual remote repository:
$ cd my-new-repo
$ ./setup-remote
And the setup-remote script takes care of:
git remote rm origin
git remote add origin .../my-new-repo.git
git push origin master
This presumes that Gitosis has been configured such that the developer can push to the remote repository.