diff options
author | Nicolas Vigier <boklm@mars-attacks.org> | 2013-07-15 19:14:36 +0200 |
---|---|---|
committer | Nicolas Vigier <boklm@mars-attacks.org> | 2013-07-15 19:14:36 +0200 |
commit | 4aef35e7048286fc4f819b591948b4847ec3f97f (patch) | |
tree | 41c83e58531eff5e7142d95767a589e7642dc551 | |
parent | 9205f1adf366d6c197d4bf0bc473f2cb408aef69 (diff) | |
download | mgagit-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-- | NEWS | 1 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | config_default | 1 | ||||
-rw-r--r-- | lib/MGA/Git.pm | 7 | ||||
-rwxr-xr-x | mgagit | 1 |
5 files changed, 13 insertions, 1 deletions
@@ -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 @@ -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} @@ -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); |