From cb18241886769cf99c09cc52feb8fc6f92d7421f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 1 Nov 2016 15:19:44 +0000 Subject: [PATCH] Bug 17534: Add script to execute everything needed to get a fresh DB Not sure it will be pushed, but at least it's shared. It will populate the DB (with records), create a superlibrarian user and rebuild zebra --- misc/devel/do_all_you_can_do.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 misc/devel/do_all_you_can_do.pl diff --git a/misc/devel/do_all_you_can_do.pl b/misc/devel/do_all_you_can_do.pl new file mode 100644 index 0000000..18983da --- /dev/null +++ b/misc/devel/do_all_you_can_do.pl @@ -0,0 +1,18 @@ +use Modern::Perl; +use File::Basename; +use IPC::Cmd qw( run ); + +my $dir = dirname $0; +my ( $cmd, $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ); + +$cmd = "sudo koha-shell kohadev -c 'perl $dir/populate_db.pl --with-records -v'"; +( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run( command => $cmd, verbose => 1 ); +exit(1) unless $success; +$cmd = "sudo koha-shell kohadev -c 'perl $dir/create_superlibrarian.pl'"; +( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run( command => $cmd, verbose => 1 ); +exit(1) unless $success; +$cmd = "sudo koha-rebuild-zebra -f -v kohadev"; +( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run( command => $cmd, verbose => 1 ); +exit(1) unless $success; + +exit(0); -- 2.1.4