eXcaleを試してみる

TISがやっているeXcaleというPaaSを試してみました。 今ならベータ期間中なので無料で利用できます。   メールで認証した後、日本人ならhogeだべ、ってやったら、、ソリャ既にありますよねとw   素直に自分のハンドルネームで。せっかくなので触れたことないnode.jsにしてみます。   サクっと出来ました。Gitなニホヒを感じます。Herokuみたいな感じですね~   ローカル(Ubuntu)に環境を作っていきます。 とりあえずPythonが入ってることを確認。

# python --version Python 2.7.3

libsslのdevが必要だってどこかでみかけたので、、

# apt-get install libssl-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libssl-doc The following NEW packages will be installed:

npmをインストールしようとすると https://registry.npmjs.orgSSLのエラーが 出ちゃってインストール出来ない的な。。

npm http GET https://registry.npmjs.org/ronn npm ERR! Error: tunneling socket could not be established, cause=47808193896256:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:749:

どーすっかなーって思ったらaptであるっすね

# apt-get install npm Reading package lists... Done Building dependency tree Reading state information... Done

んでこの勢いでexpressいれちゃる!って思ったらまたかよ、、、

# npm install -g express npm http GET https://registry.npmjs.org/express npm ERR! Error: failed to fetch from registry: express npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12

StackOverflowみてたら--registoryでSSLじゃないとこ指定出来るっぽい。

# npm install -g express --registry http://registry.npmjs.org/ npm http GET http://registry.npmjs.org/express npm http 200 http://registry.npmjs.org/express npm http GET http://registry.npmjs.org/express/-/express-3.0.5.tgz npm http 200 http://registry.npmjs.org/express/-/express-3.0.5.tgz npm http GET http://registry.npmjs.org/connect/2.7.1 npm http GET http://registry.npmjs.org/commander/0.6.1 npm http GET http://registry.npmjs.org/range-parser/0.0.4 ~略~ /usr/local/bin/express -> /usr/local/lib/node_modules/express/bin/express express@3.0.5 /usr/local/lib/node_modules/express ├── methods@0.0.1 ├── fresh@0.1.0 ├── range-parser@0.0.4 ├── cookie-signature@0.0.1 ├── buffer-crc32@0.1.1 ├── cookie@0.0.5 ├── commander@0.6.1 ├── debug@0.7.0 ├── mkdirp@0.3.3 ├── send@0.1.0 (mime@1.2.6) └── connect@2.7.1

ぽゆい感じになりました。   ここから先は↓のSphinxっぽいドキュメントに沿ってやってみます。 http://doc.excale.net/getting_started/getting_started_with_node.html

# express -V
3.0.5
# express --sessions --css stylus --ejs sampleapp

   create : sampleapp
   create : sampleapp/package.json
   create : sampleapp/app.js
   create : sampleapp/public
   create : sampleapp/public/javascripts
   create : sampleapp/public/images
   create : sampleapp/public/stylesheets
   create : sampleapp/public/stylesheets/style.styl
   create : sampleapp/routes
   create : sampleapp/routes/index.js
   create : sampleapp/routes/user.js
   create : sampleapp/views
   create : sampleapp/views/index.ejs

   install dependencies:
     $ cd sampleapp && npm install

   run the app:
     $ node app

ディレクトリ移動してポート番号変えて、app.jsをindex.jsにリネームします。

# cd sampleapp/
sampleapp# vim app.js
sampleapp# mv app.js index.js
sampleapp# cat index.js | grep 8080
  app.set('port', process.env.PORT || 8080);

GitでeXcaleのマスターブランチに突っ込みます。

sampleapp# git add .
sampleapp# git commit -m "First commit"
[master (root-commit) 672c1fa] First commit
sampleapp# git push https://git.excale.net/git/shinodogg master
Username for 'https://git.excale.net': hogehogehoge@gmail.com
Password for 'https://hogehogehoge@gmail.com@git.excale.net':
remote: Cloning into shinodogg...
remote: npm http GET http://registry.npmjs.org/express/3.0.5
remote: npm http GET http://registry.npmjs.org/ejs
remote: npm http GET http://registry.npmjs.org/stylus
remote: npm http 200 http://registry.npmjs.org/express/3.0.5
~略~
remote: ejs@0.8.3 ./node_modules/ejs
remote:
remote: stylus@0.31.0 ./node_modules/stylus
remote: ├── debug@0.7.0
remote: ├── mkdirp@0.3.4
remote: └── cssom@0.2.5
remote:
remote: express@3.0.5 ./node_modules/express
remote: ├── methods@0.0.1
remote: ├── fresh@0.1.0
remote: ├── cookie-signature@0.0.1
remote: ├── range-parser@0.0.4
remote: ├── buffer-crc32@0.1.1
remote: ├── cookie@0.0.5
remote: ├── commander@0.6.1
remote: ├── debug@0.7.0
remote: ├── mkdirp@0.3.3
remote: ├── send@0.1.0 (mime@1.2.6)
remote: └── connect@2.7.1 (pause@0.0.1, bytes@0.1.0, crc@0.2.0, formidable@1.0.11, qs@0.5.1)
remote: npm executed
remote: "deployment succeeded!!"
To https://git.excale.net/git/shinodogg
 * [new branch]      master -> master

ブラウザからアクセスしてみると↓なにやら出来てるみたいですね。   ログも↓ブラウザから参照できます。   社会人二年目くらいの時に、自宅でVineLinux立てて、Tomcatとか入れて DynamicDNSでサービス公開したりしてましたが、もうそんな事やる必要なんて全くない アイデアがあったらサクっと形に出来てしまうナイスな世の中になったものですね。  

Amazon Web Services クラウドデザインパターン 設計ガイド
玉川 憲 片山 暁雄 鈴木 宏康
日経BP
売り上げランキング: 2035