Skip to content

Latest commit

 

History

History
94 lines (73 loc) · 4.02 KB

98cf8342c31e73b9065a.md

File metadata and controls

94 lines (73 loc) · 4.02 KB
title emoji type topics published
Vagrant + GitHub(Pages) + Bitbucket + Octopress で本格的にblogを作成(その3)
📝
tech
Vagrant GitHub Bitbucket Octopress Windows
true

ようやっと

Octopress で記事を書くより環境を調査する方が楽しくなってきて本末転倒っぽくなってますw その2 の環境を作ったものの複数の環境から編集&deployするのがまた少しハマって苦労したので細かい点を残しておいてます。

構成

GitHub に Octopress で出力した結果を保存、Bitbucket に記事を保存する環境構築済みであること。 位置付けとして、deploy するのは、チームの代表者が行う。他のメンバーは執筆者としての役割なので記事のみ編集とします。 ※Jenkinsを使って自動デプロイを行うとかを将来的に考慮したりしてw

deploy だけする人の環境

とにかくマージする、deployするだけと、bitbucket からマージする。確認する。okだったら deployする。これをルーチンワーク化する。 ※1人でこれやってると疲れるよねw

$ git pull bitbucket source 
$ rake generate
$ rake preview
$ git push -u bitbucket source

記事のみ編集する人の環境

Vagrant の環境に Ruby Setup が構築済みであること。 (1). Octopress Setup

$ git clone git://github.com/imathis/octopress.git username.github.io
$ cd username.github.io
$ bundle install
$ rake install
$ rake setup_github_pages
Enter the read/write url for your repository
(For example, 'git@github.com:your_username/your_username.github.io.git)
           or 'https://github.com/your_username/your_username.github.io')
Repository url: 

(2). Bitbucket から clone

$ cd username.github.io
$ git clone git@bitbucket.org:your_username/your_username.github.io.git
$ git remote add bitbucket git@bitbucket.org:your_username/your_username.github.io.git

(3). Bitbucket から pull 初回自動的に生成されるファイルは不要なので移動しておく。細かいとこで CONFLICT が発生した場合は適宜手対応する。

$ mv Rakefile Rakefile.old
$ mv _config.yml _config.yml.old
$ mv sass sass.old
$ mv source source.old
$ git pull bitbucket source 

(4). ページを編集&push 色々と編集 rake preview で確認が終わったら。git pushする前に変更がないか念のためpullを行う癖をつけておく。

$ git add -A
$ git commit -m "add post"
$ git pull bitbucket source 
$ git push -u bitbucket source

(5). 注意点 この環境から Github に push しちゃった場合、** deploy だけする人の環境 ** の環境で問題が生じます。そんなときは、deploy だけする人の環境で Octopressでrake deployした際にrejectedされた場合の対処 を行うよろし。

(6). 常に 常には、(4)だけのルーチンでok。

Octopress のカスタマイズ

Octopressのテーマを変更してみる。 さんの記事を参考にしながらBootstrapデザインのテーマを適用してみました。結構簡単にできるのね。

octopress-category-list Category List Aside Yug_1224BlogOctopress Octopressの初期設定時に気にしておきたい9箇所 GitHub Pages + Octopress カスタマイズ vol.2

その4に続く

Jenkinsを使って自動デプロイを行う環境とか考えてみるw