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

This widget could not be displayed.

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"

This widget could not be displayed.

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

This widget could not be displayed.

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.

This widget could not be displayed.

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

This widget could not be displayed.

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

This widget could not be displayed.

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.

This widget could not be displayed.

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
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

513 views 3 18
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