前提(環境)
- 自分の手元
- 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 octopress
sudo gem install bundler
rbenv rehash
bundle install
rake install
cd ..
mkdir _deployment && cd _deployment
cp ../octopress/config.ru .
cp ../octopress/Gemfile .
bundle install
mkdir public/
git init .
-
git remote add openshift URI
ここで指定するURIはOpenShiftの2.の作業のURI git add .
git commit -am 'initial deploy'
cd ..
mv _deployment octopress
cd octopress
- Rakefileの内容をRakefile@gistで上書きし、保存
git add _deployment/
rake new_post['Hello World']
- 22.で作成したファイルを編集し、保存する
rake generate
rake gen_deploy
簡単な操作方法
記事の作成
rake new_post['title']
記事の内容を確認
rake preview
- http://localhost:4000にアクセス
記事をOpenShiftにアップロード
rake gen_deploy