FuelPHP on heroku

下ごしらえ

create fuelphp project

$ oil create heroku-fuelphp
$ cd heroku-fuelphp/
$ rm -fr .git . gitmodules
$ rm *.md
$ rm -fr docs/

自分の環境(MacOS 10.8.1/git version 1.7.8.4)だと

Adding existing repo at 'fuel/core' to the index

とか言われてsubmodule add出来ないので予め削除

$ rm -fr fuel/core/
$ rm -fr fuel/packages/auth/
$ rm -fr fuel/packages/email/
$ rm -fr fuel/packages/oil/
$ rm -fr fuel/packages/orm/
$ rm -fr fuel/packages/parser/

git init & submodule add

$ git init
$ git submodule add git://github.com/fuel/core.git fuel/core
$ git submodule add git://github.com/fuel/auth.git fuel/packages/auth
$ git submodule add git://github.com/fuel/email.git fuel/packages/email
$ git submodule add git://github.com/fuel/oil.git fuel/packages/oil
$ git submodule add git://github.com/fuel/orm.git fuel/packages/orm
$ git submodule add git://github.com/fuel/parser.git fuel/packages/parser

git submodule checkout & pull

$ git add .
$ git submodule foreach git checkout 1.3/master
$ git submodule foreach git pull origin 1.3/master
$ git status
#	modified:   fuel/core (new commits)
#	modified:   fuel/packages/orm (new commits)
$ git add fuel/core      
$ git commit -m 'init'                            

heroku create

$ heroku create --buildpack https://github.com/winglian/heroku-buildpack-php -s cedar
Creating serene-dusk-4028... done, stack is cedar
BUILDPACK_URL=https://github.com/winglian/heroku-buildpack-php
http://serene-dusk-4028.herokuapp.com/ | git@heroku.com:serene-dusk-4028.git
Git remote heroku added

git push

$ git push heroku master 
Counting objects: 54, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (46/46), done.
Writing objects: 100% (54/54), 99.37 KiB, done.
Total 54 (delta 3), reused 0 (delta 0)

-----> Heroku receiving push
-----> Git submodules detected, installing
       Submodule 'fuel/core' (git://github.com/fuel/core.git) registered for path 'fuel/core'
       Submodule 'fuel/packages/auth' (git://github.com/fuel/auth.git) registered for path 'fuel/packages/auth'
       Submodule 'fuel/packages/email' (git://github.com/fuel/email.git) registered for path 'fuel/packages/email'
       Submodule 'fuel/packages/oil' (git://github.com/fuel/oil.git) registered for path 'fuel/packages/oil'
       Submodule 'fuel/packages/orm' (git://github.com/fuel/orm.git) registered for path 'fuel/packages/orm'
       Submodule 'fuel/packages/parser' (git://github.com/fuel/parser.git) registered for path 'fuel/packages/parser'
       Initialized empty Git repository in /tmp/build_owc6gc2lo4pn/fuel/core/.git/
       Submodule path 'fuel/core': checked out '61ef4c098485035f4d625d87238e4d408dfa59e5'
       Initialized empty Git repository in /tmp/build_owc6gc2lo4pn/fuel/packages/auth/.git/
       Submodule path 'fuel/packages/auth': checked out 'd5c78ff7e3b1698334747587505d79baf59a3158'
       Initialized empty Git repository in /tmp/build_owc6gc2lo4pn/fuel/packages/email/.git/
       Submodule path 'fuel/packages/email': checked out '6a38100229aa02c905d143c200a0dac5184a174e'
       Initialized empty Git repository in /tmp/build_owc6gc2lo4pn/fuel/packages/oil/.git/
       Submodule path 'fuel/packages/oil': checked out 'e0947076c4058104f92d8465ccb82d2ac93f6b72'
       Initialized empty Git repository in /tmp/build_owc6gc2lo4pn/fuel/packages/orm/.git/
       Submodule path 'fuel/packages/orm': checked out '42a37ce5d639bc6485b907764280dca3285a2bf9'
       Initialized empty Git repository in /tmp/build_owc6gc2lo4pn/fuel/packages/parser/.git/
       Submodule path 'fuel/packages/parser': checked out 'f85eafe3ed198bf51feb7c3c1c7116aa3a77ea24'
-----> Fetching custom buildpack... cloning with git...done
 !     Heroku push rejected, no Cedar-supported app detected

To git@heroku.com:serene-dusk-4028.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:serene-dusk-4028.git'

index.phpがないとリジェクトされるらしいので作る

$ touch index.php
$ git add index.php 
$ git commit -m 'add index.php'
[master 73128cb] add index.php
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 index.php

/Users/khirose/workspace/heroku-fuelphp% touch index.php
/Users/khirose/workspace/heroku-fuelphp% git add index.php 
/Users/khirose/workspace/heroku-fuelphp% git commit -m 'add index.php'
[master 73128cb] add index.php
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 index.php
$ git push heroku master     
Counting objects: 56, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (48/48), done.
Writing objects: 100% (56/56), 99.57 KiB, done.
Total 56 (delta 4), reused 0 (delta 0)

-----> Heroku receiving push
-----> Git submodules detected, installing
       Submodule 'fuel/core' (git://github.com/fuel/core.git) registered for path 'fuel/core'
       Submodule 'fuel/packages/auth' (git://github.com/fuel/auth.git) registered for path 'fuel/packages/auth'
       Submodule 'fuel/packages/email' (git://github.com/fuel/email.git) registered for path 'fuel/packages/email'
       Submodule 'fuel/packages/oil' (git://github.com/fuel/oil.git) registered for path 'fuel/packages/oil'
       Submodule 'fuel/packages/orm' (git://github.com/fuel/orm.git) registered for path 'fuel/packages/orm'
       Submodule 'fuel/packages/parser' (git://github.com/fuel/parser.git) registered for path 'fuel/packages/parser'
       Initialized empty Git repository in /tmp/build_3so3ldgotzkpp/fuel/core/.git/
       Submodule path 'fuel/core': checked out '61ef4c098485035f4d625d87238e4d408dfa59e5'
       Initialized empty Git repository in /tmp/build_3so3ldgotzkpp/fuel/packages/auth/.git/
       Submodule path 'fuel/packages/auth': checked out 'd5c78ff7e3b1698334747587505d79baf59a3158'
       Initialized empty Git repository in /tmp/build_3so3ldgotzkpp/fuel/packages/email/.git/
       Submodule path 'fuel/packages/email': checked out '6a38100229aa02c905d143c200a0dac5184a174e'
       Initialized empty Git repository in /tmp/build_3so3ldgotzkpp/fuel/packages/oil/.git/
       Submodule path 'fuel/packages/oil': checked out 'e0947076c4058104f92d8465ccb82d2ac93f6b72'
       Initialized empty Git repository in /tmp/build_3so3ldgotzkpp/fuel/packages/orm/.git/
       Submodule path 'fuel/packages/orm': checked out '42a37ce5d639bc6485b907764280dca3285a2bf9'
       Initialized empty Git repository in /tmp/build_3so3ldgotzkpp/fuel/packages/parser/.git/
       Submodule path 'fuel/packages/parser': checked out 'f85eafe3ed198bf51feb7c3c1c7116aa3a77ea24'
-----> Fetching custom buildpack... cloning with git...done
-----> PHP app detected
-----> Bundling Apache 2.2.22/PHP 5.3.10 build
Creating Slug Identifier file with id: 11eb980091f29e7be8abbe03604ff2ac
-----> Discovering process types
       Procfile declares types -> (none)
       Default types for PHP   -> web
-----> Compiled slug size is 18.4MB
-----> Launching... done, v4
       http://serene-dusk-4028.herokuapp.com deployed to Heroku

To git@heroku.com:serene-dusk-4028.git
 * [new branch]      master -> master

成功したっぽい

$ heroku open

http://serene-dusk-4028.herokuapp.com/public/

参考:
http://d.hatena.ne.jp/Kenji_s/20111202/1322783183
http://d.hatena.ne.jp/hnw/20120603
http://dqn.sakusakutto.jp/2012/04/heroku_push_rejected_no_cedar-.html

brew install mongo

% sudo brew install mongo                                   

Password:

==> Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-1.6.5.tgz

######################################################################## 100.0%

==> Caveats

If this is your first install, automatically load on login with:

    cp /usr/local/Cellar/mongodb/1.6.5-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents

    launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist

 

If this is an upgrade and you already have the org.mongodb.mongod.plist loaded:

    launchctl unload -w ~/Library/LaunchAgents/org.mongodb.mongod.plist

    cp /usr/local/Cellar/mongodb/1.6.5-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents

    launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist

 

Or start it manually:

    mongod run --config /usr/local/Cellar/mongodb/1.6.5-x86_64/mongod.conf

==> Summary

/usr/local/Cellar/mongodb/1.6.5-x86_64: 16 files, 83M, built in 2 seconds

ねんがんのはてなブログをてにいれたぞ

@hachimitu → @ninochi → @picacch → @elpeo → @inuro → @tnh  @hirose504

と言うわけで連綿と受け継がれた流れの果てにはてなブログを手に入れました