前提(環境)
- 自分の手元
- Mac
- Web
- OpenShift
準備
- OpenShiftのSignUp
-
gem install rhcしておく(自分の手元)- installの初期セットアップでOpenShiftとのSSH設定も行われる
手順
- OpenShiftでの作業
- Ruby1.9.3以上を作成する
- Application画面の右下に出ている"SourceCode"の下にある
ssh:〜をコピーしておく
- 手元の作業
- 好きなフォルダーを作る
git clone git://github.com/imathis/octopress.git octopress && cd octopresssudo gem install bundlerrbenv rehashbundle installrake installcd ..mkdir _deployment && cd _deploymentcp ../octopress/config.ru .cp ../octopress/Gemfile .bundle installmkdir public/git init .-
git remote add openshift URIここで指定するURIはOpenShiftの2.の作業のURI git add .git commit -am 'initial deploy'cd ..mv _deployment octopresscd octopress- Rakefileの内容をRakefile@gistで上書きし、保存
git add _deployment/rake new_post['Hello World']- 22.で作成したファイルを編集し、保存する
rake generaterake gen_deploy
簡単な操作方法
記事の作成
rake new_post['title']
記事の内容を確認
rake preview- http://localhost:4000にアクセス
記事をOpenShiftにアップロード
rake gen_deploy