前回ブログに書いたbitBucketを本格的に使おうと思い bitBucket+Capistranoでデプロイできるように設定しました。 もともとsvnでは使用していたもののgitになると勝手が違う。。 設定を行うついでに、capistrano-extをインストールして、 multistageというコマンド実行時にデプロイ先を選択できるように作りました。 これでいちいちdeploy.rbを書き換えること無くProduction,Staging,Develop それぞれのサーバーに配置できるように! こういう感じの構成↓ ということで以下手順。 GITのインストール 前書いた記事↓ gitをさくらサーバーへインストールする方法 http://d.hatena.ne.jp/oggata/20100201/1266908009 rubyのインストール cd /usr/local/src wget
There are many different ways to handle deployments, but I have become very fond of using Bitbucket’s service hooks. In this case we’re going to be using the POST service hook, which is basically a git post-receive hook that sends a POST request to a given url every time you push to your repository. Note: This is a really simple and effecient way to handle deployments for smaller projects (e.g. St
static なサイトを作るにあたっては、「コミット + scp などでファイルを一気に転送」を繰り返すことがよくある方法だと思う。 github pages のように、 git push のみでできると楽なのでこの環境を構築してみた。 さくらレンタルサーバー以外でも使える方法なのでそこそこ応用が効きそう。 サーバに git 環境を構築する % cd $HOME % mkdir tmp; cd tmp; % wget http://kernel.org/pub/software/scm/git/git-1.7.6.tar.gz % tar xvf git-1.7.6.tar.gz % cd git-1.7.6 % ./configure --prefix=$HOME/local % gmake % gmake install % vi $HOME/.profile PATH に $HOME
時間が時間なので、さくっと。 gitでpushするとdeploy、というgitでソースコードなど管理してる場合にはかなりお手軽な反映方法なんだけど、その方法が綺麗にまとまってなかった。試行錯誤しつつようやく出来上がったのでメモとして残しておく。 作業した環境は、さくらVPS上のdebian。debianの導入周りとかはやってる人もおおいので割愛。 gitユーザをつくる adduser --disabled-password git su - git リモートのgitリポジトリをつくる mkdir ~/repos cd ~/repos mkdir Hoge.git cd Hoge.git git init --bare vim hook/post-receive #次の一文を足す (cd /home/git/www/Hoge; git --git-dir=.git pull) chmod +
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く