Amon2のDotCloud Flavorでハマった。

Setup Amon2 application with Dotcloud — Amon2 6.13 documentation
この手順どおりやればdotcloudでAmon2で作ったアプリが動き出すはずなんだけど、

$ dotcloud create --flavor=DotCloud,Basic MyApp
# upload /home/username/dev/MyApp ssh://dotcloud@uploader.dotcloud.com:443/myapp
# git
Warning: Permanently added '[uploader.dotcloud.com]:443,[184.73.14.49]:443' (RSA) to the list of known hosts.
Everything up-to-date
Deployment for "myapp" triggered. Will be available in a few seconds.
2011-11-08 16:16:40 [api] Deploy amon2test scheduled for revision=git-a92a5cf
2011-11-08 16:16:40 [api] Expected a type dictionary but got a type string in "dotcloud.yml", line 2, column 3

Deployment finished. Your application is available at the following URLs
error: No URL found.

エラー。dotcloud.ymlが駄目みたい。
中を見る。

www:
  perl

これを修正。

www:
  type: perl


修正したので、再度push。

$ dotcloud create --flavor=DotCloud,Basic MyApp
# upload /home/username/dev/MyApp ssh://dotcloud@uploader.dotcloud.com:443/myapp
# git
Warning: Permanently added '[uploader.dotcloud.com]:443,[184.73.14.49]:443' (RSA) to the list of known hosts.
Everything up-to-date
Deployment for "myapp" triggered. Will be available in a few seconds.
2011-11-08 16:16:40 [api] Deploy amon2test scheduled for revision=git-a92a5cf
2011-11-08 16:16:40 [api] Expected a type dictionary but got a type string in "dotcloud.yml", line 2, column 3

Deployment finished. Your application is available at the following URLs
error: No URL found.

変わらず。


ここでしばらくハマったんだけど、

もし指定されたディレクトリに.gitディレクトリがあれば、リモートにgit pushしたのと同じような動作になる。つまり、git commitしてないファイルはpushされない。自分はとりあえず作業量のディレクトリを作り、git initした。
http://mt.endeworks.jp/d-6/2011/04/dotcloud-psgi-hello-world.html

ということらしい。


git comitt。

git add dotcloud.yml
git commit -m "change dotcloud.yml"


再度push。

$ dotcloud push myapp./
# upload ./ ssh://dotcloud@uploader.dotcloud.com:443/myapp
# git
Warning: Permanently added '[uploader.dotcloud.com]:443,[184.73.14.49]:443' (RSA) to the list of known hosts.
Counting objects: 52, done.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (52/52), 53.59 KiB, done.
Total 52 (delta 8), reused 0 (delta 0)
To ssh://dotcloud@uploader.dotcloud.com:443/myapp
 * [new branch]      master -> master
Deployment for "myapp" triggered. Will be available in a few seconds.
2011-11-09 23:02:01 [api] Deploy myapp scheduled for revision=git-0f13db7
2011-11-09 23:02:01 [api] Waiting for the build. (It may take a few minutes)
2011-11-09 23:02:01 [www.0] Deploying...
略
2011-11-09 23:06:47 [www.0] The build finished successfully
2011-11-09 23:06:47 [api] Deploy finished

Deployment finished. Your application is available at the following URLs
www: http://myapp-username.dotcloud.com/


できた。


単純なことなんだけど、一応rt.cpan.orgで報告しておいた。
Bug #72301 for Amon2: dotcloud.yml error. Amon2::Setup::Flavor::DotCloud


そしたら数時間で返事が来て、さっきバージョン上げたら直ってた。
http://d.hatena.ne.jp/tokuhirom/20111109/1320850275
すげえ…