NanoAでiPhoneアプリサポートサイトを作ってみることにした
ブログ上の1エントリにサポートコンテンツをつくってはみたものの、URLがぱっとしないのが気に食わなかった。なのでブログ上のエントリではなく、一コンテンツとして別に立ち上げることにした。
Catalystとか習熟のいい機会かなと思ったけど、そこまで大げさなものでもないし手間かけるのも面倒なので軽量フレームワークを使う事にした。YacafiやMENTAで作ることを試してみたけど、個人的にNanoAがしっくりきそうなのでNanoAに。
ローカルにインストール
ローカルで開発を行い、さくら共有レンタルサーバ上にpublishすることにする。NanoAのインストール方法は公式サイトにしっかり掲載されていたものの、実際のインストール中にエラーが生じるため(参照 nanoaを動かしてみる0.000000001 - LAPISLAZULI HILL#Hatena)、trunkから取得することに。
$cd ~/sites $svn co http://svn.coderepos.org/share/lang/perl/NanoA/trunk iPhoneApp A iPhoneApp/app/***** U iPhoneApp 外部項目を 'iPhoneApp/tgz2cgi' に取得しています A iPhoneApp/tgz2cgi/tgz2cgi.pl 外部項目 (リビジョン 30494) をチェックアウトしました。 外部項目を 'iPhoneApp/MENTA' に取得しています A iPhoneApp/MENTA/***** U iPhoneApp/MENTA 外部項目 (リビジョン 30494) をチェックアウトしました。 $chmod 777 iPhoneApp
ブラウザからアクセスするとパスワードの設定画面となるので入力する。
gitで管理
「gitあれば憂いなし」とは言わないけれど、gitで管理することにした。
$cd iPhoneApp $git init Initialized empty Git repository in /Users/USERNAME/Sites/iPhoneApp/.git/ $git add . # new file:***** $git commit -a
変更部分に関する表記がでる。一番上にコメント付与用の空行があるので入力。
Initial commit
とりあえずbranch。
$git branch alpha-0.1 $git checkout alpha-0.1 Switched to branch "alpha-0.1"
さくらレンタルサーバ上にリモート先をつくる
まだgit導入してなかったのでインストール。
$ssh haoyayoi.sakura.ne.jp Welcome to FreeBSD! %cd local/src %wget http://kernel.org/pub/software/scm/git/git-1.6.1.3.tar.gz %tar xvfz git-1.6.1.3.tar.gz %cd git-1.6.1.3.tar.gz %./configure --prefix=$HOME/local
makeしようとしたらエラー。gmakeじゃないとだめらしい。
参照 サクラのレンタルサーバーでgitを使う
%gmake %gmake install %rehash
git init。
%mkdir ~/www/iPhoneApp %cd ~/www %chmod 707 iPhoneApp %cd iPhoneApp %git init Initialized empty Git repository in /home/USERNAME/www/iPhoneApp/.git %exit
ローカルリポジトリにリモート先を加える
さくら上のリポジトリにpushおよびpullするためにremoteの設定をいれる。
$git remote add origin ssh://haoyayoi.sakura.ne.jp/home/USERNAME/www/iPhoneApp/.git
ついでにリモート先へ反映させてみる。
$git push origin master Counting objects: 1018, done. Compressing objects: 100% (956/956), done. Writing objects: 100% (1018/1018), 1.00 MiB | 931 KiB/s, done. Total 1018 (delta 166), reused 0 (delta 0) warning: updating the currently checked out branch; this may cause confusion, as the index and working tree do not reflect changes that are now in HEAD. To ssh://haoyayoi.sakura.ne.jp/home/USERNAME/www/iPhoneApp/.git * [new branch] master -> master
git push時のメモ。
$git push 反映先 反映元