From 0f8ed472359d59b6b259e4a6ba3e64529c5a3577 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 17 Aug 2014 13:14:12 -0400 Subject: optionally mirror the checkout to another repository --- lib/Crawl/Bot/Plugin/Commit.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm index 9344dde..652b067 100644 --- a/lib/Crawl/Bot/Plugin/Commit.pm +++ b/lib/Crawl/Bot/Plugin/Commit.pm @@ -10,6 +10,12 @@ has repo_uri => ( default => 'git://gitorious.org/crawl/crawl.git', ); +has mirror_uri => ( + is => 'ro', + isa => 'Str', + default => 'git@github.com:crawl-ref/crawl-ref', +); + has announce_commits => ( is => 'rw', isa => 'Bool', @@ -171,6 +177,11 @@ sub tick { my $dir = pushd($self->checkout); warn "fetch"; system('git fetch'); + + if (my $mirror = $self->mirror_uri) { + system("git push --mirror $mirror"); + } + for my $branch ($self->branches) { my $old_head = $self->head($branch) || ''; warn "rev-parse $branch"; -- cgit v1.2.3-54-g00ecf