Gerbera の GitHub pages を Travis に任せることにしたのでメモしとく
Travis, 最初に git clone --branch=master
して、 master
ブランチだけを持ってくることになっている。
gh-pages
ブランチもほしいので .travis.yml
で
git fetch origin gh-pages:gh-pages
git checkout gh-pages
とかやった。
一度ローカルの Ubuntu 12.04 (VM) で試そうとして、同じように git clone --branch=master
したら、なぜかそのまま git checkout gh-pages
できてしまって混乱した。
git version
したら 1.7.9 とか言われたのでこれが原因っぽかった。
1.7.10 で git clone --single-branch
オプションが追加されて、 --depth
を指定するとデフォルトでひとつのブランチだけを clone するようになったっぽい。
Clone only the history leading to the tip of a single branch, either specified by the
--branch
option or the primary branch remote'sHEAD
points at. When creating a shallow clone with the--depth
option, this is the default, unless--no-single-branch
is given to fetch the histories near the tips of all branches.
最新の Git 1.9.3 を入れたら思ったとおりに動くようになった。
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
あと vagrant で npm install -g
しようとするとコケるので、 npm install -g --no-bin-links
とやるとうまくいく。
browserify する:
git checkout master -- src
coffee -c src
browserify index.js > Gerbera.js
index.js
を以下のようにしてみたのでブラウザなら window.Gerbera
に生えるし node なら require
できる:
var Gerbera = require('./src/Gerbera');
if('self' in global){
global.Gerbera = Gerbera;
} else {
module.exports = Gerbera;
}
次のページを参考にして GitHub のアクセストークンをつくってこれやった:
gem install travis
travis encrypt --add -r xl1/gerbera "GH_TOKEN=トークン"
久々に gem install
しようとしたら certificate verify failed
とか言われてコケたので、調べて証明書をなんかやったら直った。