summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-08-17 13:14:12 -0400
committerJesse Luehrs <doy@tozt.net>2014-08-17 13:14:12 -0400
commit0f8ed472359d59b6b259e4a6ba3e64529c5a3577 (patch)
treedfc8ebd5e63f1e5cd9d92804e3d36391cd8b91e4
parente875ac69b4cc59852412bf09b36f5f272f8acc21 (diff)
downloadcrawlbot-0f8ed472359d59b6b259e4a6ba3e64529c5a3577.tar.gz
crawlbot-0f8ed472359d59b6b259e4a6ba3e64529c5a3577.zip
optionally mirror the checkout to another repositoryHEADmaster
-rw-r--r--lib/Crawl/Bot/Plugin/Commit.pm11
1 files changed, 11 insertions, 0 deletions
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";