自從去年接觸Cloud與SaaS以來,就一直想自己搞個什么東西。但之前的開發是基于AWS,沒有美刀,就想在免費的Paas上牛刀小試了。
開始是GAE,可惜Google和ZF不對付,開始還能用用,后來干脆咯屁,所以不了了之。
后來又有了VMWare Cloud Foundry與DotCloud,感覺各有千秋。VMWare的 Micro Cloud Foundry 很是吸引我,但是Cloud Foundry的申請比較麻煩些,好不容易找了個時間把玩把玩,等不了VMWare的爺們了。說干就干,就拿DotCloud開刀。
對了,它的空間大小限制:
For the Free plan, database services default to 10 MB of disk, and 10 MB of RAM.
With the Pro plan, database services have 10 GB of disk, and 300 MB of RAM
>> 安裝Command Line Interface
跟Amazon EC2一樣,DotCloud也提供了一個CLI,用于平時的管理(呵呵,其實DotCloud本身就跑在了Amazon EC2上)。
不過DotCloud CLI是基于Linux的,在Windows上沒有官方支持,汗!!幸好有好事者kalman Speier搞出一個Work Around,竟被DotCloud的同志們引用,更貼心的是,Kalman君還做一個安裝包,不需配置過程,安裝即可。感謝kalman Speier,否則我到此就要打道回府了。
https://github.com/speier/DotCloudWin
https://github.com/speier/DotCloudWin/downloads
>> 常用的DotCloud命令
--------------------------------------------------------------
positional arguments:
? {info,status,stats,run,logs,versions,url,setup,list,rollback,alias,ssh,push,de
stroy,create,restart,history}
??? setup?????????????? setup your api key
??? history???????????? display the last commands you ran
???
create
????????????? create an application
???
push
??????????????? push your application
??? list??????????????? list your applications
??? versions??????????? list the versions of your application
??? run???????????????? run a remote command
??? logs??????????????? read logs
??? alias?????????????? bind a custom domain name to a service
??? destroy???????????? destroy your application
??? url???????????????? display URL(s) of your application
??? info??????????????? get information about your application or service
??? status????????????? check the status
??? stats?????????????? display the HTTP stats of your service
??? rollback??????????? rollback your service to the previous pushed version
??? ssh???????????????? open an SSH session
??? restart???????????? restart your service
optional arguments:
? -h, --help??????????? show this help message and exit
-------------------------------------------------------------
最關鍵的就是create/push。前者用來創建一個新的應用,而后者就是用來更新的。
>> 創建一個新的應用
物理結構:
值得注意的是,需要在根目錄添加一個配置文件dotcloud.yml.因為這個東西只是一個簡單的static HTML應用,很容易:
dotcloud.yml:
--------------------------------------------
www:
? type: static
--------------------------------------------
命令行與閹割后的結果:
D:\Piaoger\dotcloud>dotcloud create todolist
Created application "todolist"
D:\Piaoger\dotcloud>dotcloud push? todolist
Deployment finished. Your application is available at the following URLs
www: http://todolist-piaoger.dotcloud.com/
>> 檢查成果
點開 http://todolist-piaoger.dotcloud.com/
呵呵,此路已通,終于可以開始我的JavaScript/HTML3/CSS3了。
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
