GrowthforecastをIBM Bluemixで動かしてみる
<<工事中>>
GrowthForecastをherokuで動かしてみる 2014年度版 を参考に手順を作っていこう。
GrowthForecastの最新版ベースにBluemixで動くように拡張する
githubでforkして
git clone https://github.com/kazeburo/GrowthForecast
cpanfileの追記
requires 'DBD::mysql';
Procfileを追加
web: perl -Mlib=./local/lib/perl5 run.pl -port $PORT
run.plを追加
use strict;
use warnings;
use JSON;
use Getopt::Long;
my $port;
GetOptions ("port=i" => \$port)
or die("Error in command line arguments\n");
my $json = JSON->new->allow_nonref;
my $vcap = $json->decode($ENV{VCAP_SERVICES});
my $cre = $vcap->{"mysql-5.5"}->{credentials};
$ENV{MYSQL_USER} = $cre->{user};
$ENV{MYSQL_PASSWORD} = $cre->{password};
my $mysql = "dbi:mysql:$cre->{name};hostname=$cre->{host}:$cre->{port}";
system("perl -Mlib=./local/lib/perl5 growthforecast.pl -with-mysql $mysql -port $port");
デプロイ
cf push gf -b https://github.com/miyagawa/heroku-buildpack-perl.git
しかし、やっぱり甘くなかった。。
! Installing the dependencies failed: Module 'Alien::RRDtool' is not installed
ギブアップ。やめよう。