aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mars-attacks.org>2013-07-15 19:14:36 +0200
committerNicolas Vigier <boklm@mars-attacks.org>2013-07-15 19:14:36 +0200
commit4aef35e7048286fc4f819b591948b4847ec3f97f (patch)
tree41c83e58531eff5e7142d95767a589e7642dc551
parent9205f1adf366d6c197d4bf0bc473f2cb408aef69 (diff)
downloadmgagit-4aef35e7048286fc4f819b591948b4847ec3f97f.tar
mgagit-4aef35e7048286fc4f819b591948b4847ec3f97f.tar.gz
mgagit-4aef35e7048286fc4f819b591948b4847ec3f97f.tar.bz2
mgagit-4aef35e7048286fc4f819b591948b4847ec3f97f.tar.xz
mgagit-4aef35e7048286fc4f819b591948b4847ec3f97f.zip
Dump repos db in a yaml file when running glrun
-rw-r--r--NEWS1
-rw-r--r--README4
-rw-r--r--config_default1
-rw-r--r--lib/MGA/Git.pm7
-rwxr-xr-xmgagit1
5 files changed, 13 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 8d0f9ad..29bacf8 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
- provide access to users ldap infos from templates
- in repos_config, allow giving a git_url instead of a directory path,
to be cloned and pulled automatically
+- dump repos db in a yaml file when running glrun
Version 0.4
diff --git a/README b/README
index 8406176..ed9060c 100644
--- a/README
+++ b/README
@@ -66,6 +66,10 @@ The following configuration options are available :
tmpl_dir:
templates directory
+ www_dir:
+ output directory where some files are written (repos db dump, and
+ some html pages)
+
gitolite_config:
gitolite configuration file
diff --git a/config_default b/config_default
index a980bef..7cd49b9 100644
--- a/config_default
+++ b/config_default
@@ -20,3 +20,4 @@ repos_config:
ldap_users_infos:
- cn
- sshpublickey
+www_dir: /var/lib/git/www
diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm
index 6b8ac11..99d71d4 100644
--- a/lib/MGA/Git.pm
+++ b/lib/MGA/Git.pm
@@ -2,7 +2,7 @@ package MGA::Git;
use strict;
use Git;
-use YAML qw(LoadFile);
+use YAML qw(LoadFile DumpFile);
use Template;
use File::Slurp;
use File::Basename;
@@ -201,6 +201,11 @@ sub update_gitolite_keydir {
}
}
+sub dumpdb {
+ my ($r) = @_;
+ DumpFile($config->{www_dir} . '/repos.yaml', $r);
+}
+
sub update_gitolite_config {
my ($r) = @_;
my $oldconf = -f $config->{gitolite_config}
diff --git a/mgagit b/mgagit
index 268046f..7cb960c 100755
--- a/mgagit
+++ b/mgagit
@@ -73,6 +73,7 @@ sub glrun {
MGA::Git::load_gitrepos(\%r);
MGA::Git::load_groups(\%r);
MGA::Git::load_users(\%r);
+ MGA::Git::dumpdb(\%r);
MGA::Git::update_gitolite_keydir(\%r);
MGA::Git::update_gitolite_config(\%r);
MGA::Git::run_gitolite(\%r);