I have a few private Git repositories on Bitbucket that I need mirrored locally behind a firewall so we can use gerrit with them. The goal is that every time there is a push to the clone, the clone then pushes the new refs to bitbucket, and vice versa.
Hi Andrew,
To mirror changes from Gerrit to Bitbucket, you could use replication.
To mirror changes from Bitbucket to Gerrit, there are a couple of different options. The easiest way would be to have a cron job or other scheduled task that polls the Bitbucket repository for changes and then updates your Gerrit repo. If you want to set up a more efficient "push" method, you'd need to configure a POST Hook on your Bitbucket repository that triggers some kind of web service that pulls the changes down and pushes them in to your Gerrit repository.
I wrote a little bit more about one way you could handle two-way mirroring in this answers post: https://answers.atlassian.com/questions/325269/move-changes-from-disconnected-stash-repositories
cheers,
Tim
Thanks for the response. I'll try this out. Seems like the simplest would be a single cron job that runs the pulls and pushes in both directions. I might try that first to see if this works and doesn't create too much load on any servers before trying something more complex. I'll get back to you with my results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally had a chance to try this out. I created a cron job that runs every few seconds and syncs the repos. Seems to work for now. Thanks for your suggestions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know anything about them, but you probably need to research "hooks".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.