世界のやまさ

SEKAI NO YAMASA

AppHarbor を試した

ちょっと前にこんなツイートして


調べてみたらAppHarborというところがあった。
本当に heroku for .NET って感じで利用できる。

使い方も簡単です。
まず、今回は GitHub と AppHarbor をリンクさせます。(Webからクリックするだけで完了)
次に GitHub に Push します。

git add .
git commit -m "first commit"
git push

すると、勝手に AppHarbor がソースを同期してビルドし始めます。
数秒すると結果がトップページに表示され、アプリにアクセスできます。
今回デプロイしたのは ASP.NET MVC4 テンプレのまま以下に作りました。
http://mvc4sample.apphb.com/

なお、.NET Framework 4.5 はビルドに失敗します。
以下のようなログが表示されますので、.NET Framework 4.5 が入っていないみたい。

Build started 7/21/2012 12:33:57 AM.
Project "D:\temp\zn1naisy.srd\input\MvcApplication1\MvcApplication1.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Any CPU".
Project "D:\temp\zn1naisy.srd\input\MvcApplication1\MvcApplication1.sln" (1) is building "D:\temp\zn1naisy.srd\input\MvcApplication1\MvcApplication1\MvcApplication1.csproj" (2) on node 1 (default targets).
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847,9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\temp\zn1naisy.srd\input\MvcApplication1\MvcApplication1\MvcApplication1.csproj]
PrepareForBuild:

MVC4 は .NET Framework 4.0 で動くので、4.0ベースでデプロイすれば問題ありません。

それにしても便利ですね。DB がまだ使えないんですが、20MBまでは無料で使えるようなので、とりあえず使いたいだけなら Azure とかいらないですね。