Permalink
Browse files

add config & run files for biopay website

  • Loading branch information...
1 parent ce9118f commit e4f029c2ab7b27fac0a8f8c457d30ee17aada7df Luke Closs committed Jul 17, 2012
Showing with 52 additions and 4 deletions.
  1. +15 −0 bin/install
  2. +19 −0 etc/nginx/biopay.conf
  3. +15 −0 etc/service/biopay/run
  4. +3 −4 postinstall
View
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+export INSTALL_DIR=/var/www/biopay
+
+# Copy files into place
+sudo cp etc/nginx/biopay.conf /etc/nginx/sites-available
+sudo cp -R etc/service/biopay /etc/service
+cp -R bin lib views environments etc app.psgi public $INSTALL_DIR
+
+# Set up config file
+./postinstall
+
+# Restart services
+sudo /etc/init.d/nginx restart
+sudo svc -h /etc/service/biopay
View
@@ -0,0 +1,19 @@
+upstream dev {
+ server 127.0.0.1:6000;
+}
+
+server {
+ listen 80;
+ server_name billing-test.vancouverbiodiesel.org;
+
+ access_log /var/log/nginx/biopay-access.log;
+ error_log /var/log/nginx/biopay-error.log;
+
+ root /var/www/biopay;
+
+ location / {
+ proxy_redirect off;
+ proxy_set_header Host $host;
+ proxy_pass http://dev;
+ }
+}
View
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Set it up to use the locally installed Perl 5.16.0
+export PATH="/home/biopay/perl5/perlbrew/perls/perl-5.16.0/bin:$PATH"
+PERL_CPANM_OPT="--local-lib=/home/biopay/perl5"
+source /home/biopay/perl5/perlbrew/etc/bashrc
+
+BIO=/var/www/biopay
+export PERL5LIB="$BIO/lib"
+
+cd $BIO
+exec 2>&1 \
+ /home/biopay/perl5/perlbrew/perls/perl-5.16.0/bin/starman --listen 127.0.0.1:6000 --workers 2 --preload-app \
+ --user biopay --group www-data \
+ $BIO/app.psgi >> /var/log/biopay-web.log 2>&1
View
@@ -1,21 +1,20 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use FindBin;
use JSON qw/decode_json/;
use IO::All;
-my $services_file = "$FindBin::Bin/../services.json";
+my $services_file = "/etc/biopay.json";
die "Couldn't find services file: $services_file!" unless -e $services_file;
my $service_content < io $services_file;
my $services = decode_json $service_content;
-my $dancer_config_template = "$FindBin::Bin/etc/config.yml";
+my $dancer_config_template = "/var/www/biopay/etc/config.yml";
my $dancer_config < io $dancer_config_template;
$dancer_config =~ s/\Q****____MERCHANT_ID____****\E/$services->{merchant_id}/;
$dancer_config =~ s/\Q****____MERCHANT_HASH_KEY____****\E/$services->{merchant_hash_key}/;
$dancer_config =~ s/\Q****____COUCH_URI____****\E/$services->{iriscouch_uri}/;
$dancer_config =~ s/\Q****____DEV_KEY____****\E/$services->{session_key}/;
-$dancer_config > io "$FindBin::Bin/config.yml";
+$dancer_config > io "/var/www/biopay/config.yml";

0 comments on commit e4f029c

Please sign in to comment.