Skip to content

Commit

Permalink
fixed git_bin not found bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-kimoto committed Mar 31, 2013
1 parent 92a31fb commit 2d2cde3
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 15 deletions.
64 changes: 60 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,63 @@ Github clone. you can install portable github system into unix/linux.
* Github clone
* Perl 5.8.7+ only needed

# Instllation into Unix/Linux system
# Instllation into Shared Server (Linux or Unix/Apache/SuExec/CGI/PHP5)

If you want to use GitPrep in Sahred Server,
you can use it.

Sahred Server must support Linux/Unix, Apache, SuExec, CGI, PHP5.
Many shared server support these,
so you will find needed server easily.

you also need git.

## Download

You donwload GitPrep.

https://github.com/yuki-kimoto/gitprep/archive/0.03.zip

You expand zip file. You see the following directory.

gitprep-0.03

Rename this gitprep-0.03 to gitprep.

gitprep-0.03 -> gitprep

## Add git command path

GitPrep need git command. you must install git by yourself.

and you must add git command path into config file **gitprep.conf**

[basic]
;;; Git command path
git_bin=/home/yourname/local/git

## Upload Server by FTP

You upload these directory into server document root by FTP.

## Setup

Access the following URL by browser.

http://(Your host name)/gitprep/setup/setup.php

And click Setup button once and wail abount 5 minutes.

## Go to application

If you see result, click "Go to Application".

## You see Internal Server Error

If you see internal server error, you see gitprep/log/production.log.
You know what error is happned.

# Instllation into your Unix/Linux system

## Create gitprep user

Expand All @@ -21,9 +77,9 @@ At first create **gitprep** user. This is not nesessary, but recommended.

Download tar.gz archive and exapand it and change directory.

curl -kL https://github.com/yuki-kimoto/gitprep/archive/0.02.tar.gz > gitprep-0.02.tar.gz
tar xf gitprep-0.02.tar.gz
cd gitprep-0.02
curl -kL https://github.com/yuki-kimoto/gitprep/archivegitprep-0.03.tar.gz > gitprep-0.03.tar.gz
tar xf gitprep-0.03.tar.gz
cd gitprep-0.03

## Setup

Expand Down
5 changes: 5 additions & 0 deletions gitprep.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
;;; SSH port
;ssh_port=55555

;;; Git command path
;git_bin=/usr/local/bin/git
;git_bin=~/local/git


[hypnotoad]
listen=http://*:10020
24 changes: 16 additions & 8 deletions lib/Gitprep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use Gitprep::API;
use Carp 'croak';
use Gitprep::RepManager;
use Scalar::Util 'weaken';
use Carp 'croak';

has 'git';
has 'dbi';
Expand All @@ -29,24 +30,31 @@ sub startup {
my $my_conf_file = $self->home->rel_file('gitprep.my.conf');
$self->plugin('INIConfig', {file => $my_conf_file}) if -f $my_conf_file;

# Config
my $conf = $self->config;
$conf->{root} = $self->home->rel_file('rep');
$conf->{hypnotoad} ||= {listen => ["http://*:10020"]};
my $listen = $conf->{hypnotoad}{listen} || '';
if ($listen ne '' && ref $listen ne 'ARRAY') {
$listen = [ split /,/, $listen ];
}
$conf->{hypnotoad}{listen} = $listen;

# Added public directory
push @{$self->static->paths}, $conf->{root};

# Git
# Git command
my $git = Gitprep::Git->new;
my $git_bin = $conf->{git_bin} ? $conf->{git_bin} : $git->search_bin;
die qq/Can't detect git command. set "git_bin" in gitprep.conf/
unless $git_bin;
my $git_bin = $conf->{basic}{git_bin} ? $conf->{basic}{git_bin} : $git->search_bin;
unless ($git_bin) {
my $error = "Can't detect git command. set git_bin in gitprep.conf";
$self->log->error($error);
croak $error;
}
unless (-e $git_bin) {
my $error = "$git_bin is not found";
$self->log->error($error);
croak $error;
}
$git->bin($git_bin);

# Repository home
my $rep_home = $self->home->rel_file('rep');
$git->rep_home($rep_home);
unless (-d $rep_home) {
Expand Down
4 changes: 1 addition & 3 deletions script/gitprep.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ BEGIN {
my $extlib = join('/', @base_dir, 'extlib', 'lib', 'perl5');
eval 'use lib $mojolegacy, $extlib, $lib';
croak $@ if $@;

$DB::single = 1;
1;
}

use Mojolicious::Commands;
Expand All @@ -32,4 +29,5 @@ Please visit http://mojolicio.us for detailed installation instructions.
EOF

# Start commands
$ENV{MOJO_MODE} = 'production';
Mojolicious::Commands->start_app('Gitprep');

0 comments on commit 2d2cde3

Please sign in to comment.