Bulk adding GIT Repositories?

Merkle Germany GmbH August 5, 2013

Hi,

we want to add 300+ Projects to the GIT Plugin. Is there a way to do this via cmdline/curl/sql ?

Regards

Patrick

7 answers

1 accepted

2 votes
Answer accepted
Andrey Levchenko August 15, 2013

Hi

This curl command works for me:
curl \
	-u admin:admin  \
	-X POST \
	--data "displayName=test2&root=/home/andrey/work/dmd/test-repo&enableFetches=true&origin=git@github.com:AndreyLevchenko/test-repo.git&revisionIndexing=true&revisionCacheSize=10000" \
	"http://localhost:2990/jira/secure/AddGitRepository.jspa"

1 vote
Adam Wride
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2014

Jim - we're looking at a UI for this functionality. If we decide to proceed with development, I will update here with progress. Cheers!

Jim Gust March 25, 2014

Good to hear. The plugin otherwise does exactly what we need, this would be icing on the cake.

1 vote
Eric Sakowski August 15, 2013

That worked for me, thanks! I wrapped it in a little quickie script using my local gitolite server as origin (sanitized):

#!/bin/sh

#Given a directory full of directories full of repos, fx ./frontend_repos/{repo1,repo2,repo3} and ./backend_repos/{repoA,repoB,repoC}

for dir in frontend_repos backend_repos
do
  cd $dir
  ls -C1| while read i
  do
    echo "$dir --  $i"
    curl -u admin:password -X POST --data "displayName=$i&root=/home/jira/git/$dir/$i&enableFetches=true&origin=gitolite@my.domain.net:$dir/$i.git&revisionIndexing=true&revisionCacheSize=10000" http://localhost:8080/jira/secure/AddGitRepository.jspa
     
  done
  cd ..
done

0 votes
Adam Wride
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2017

Updating this old conversation as we have added a number of APIs and functionality for admins to add large numbers of repositories: https://bigbrassband.com/api-doc.html

Any questions can be directed to support@bigbrassband.com.

0 votes
Jim Gust March 23, 2014

It's great we have a workaround, but is there any chance this can become part of the product? I don't mind getting my hands dirty but it would be much cleaner to do it through the admin UI.

0 votes
Merkle Germany GmbH August 21, 2013

Thanks Andrey and Eric, you saved me a lots of work! Script works like a charm

0 votes
MB
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2013

Did you ask people who are developing that plugin ? There is a link to Support and Issues which might help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events