Bulk adding GIT Repositories?

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

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"

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

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

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

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

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

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.

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published 10 hours ago in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

34 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you