絶対完全無料ツールの紹介

エンジニア目線のブログです

gitでデプロイまでを考えた時の手順

ソースをgithubから本番サーバーへダウンロード
git fetch

git merge origin/master
masterだけでは足りなかったのでorigin/masterをつけました。

テスト漏れでもし予期せぬ障害があったら、タグでチェックアウトして戻す。
git checkout タグ名
==============================
Note: checking out 'v0.9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 4b01a06... Merge branch 'master' of github.com:komi2013/review
==============================

新しく開発したソースをマージ
git merge origin/master

タグ名でチェックアウトするとえらいメッセージが出るので、
こういったやりかたは無理があるのかなぁ??

開発はブランチを切っているものとするので予期せぬ障害があった時は
開発サーバーで障害があった本番用のソースにチェックアウトしてバグを直すという
流れだと思います。

その間はそれまで行われていた開発は一旦ストップという方向でしょうか??

その2 git ignoreの設定

application/logs/
application/config/
application/cache/
application/bootstrap.php

configディレクトリとbootstrap.php
ignoreに入れればドメイン毎にDBの設定が可能になる、
facebook,twitter等のAPI連携でもdomain.phpファイルを作成して
各々のドメイン毎に設定が可能
gitignoreに設定せずに、dev,stg,prd用にDB設定したでかいconfigファイルには反対
configファイルは管理しづらくなるし、どっちみちSetEnv等で設定しないといけないし。
コンフィグファイルは基本的にほとんど変更がない状態がこのましい。
定義的なファイルはモデルで設定すべし。


git ignoreの設定キャッシュ

無視できていないので検索すると、キャッシュが効いているみたい。
http://blog.9wick.com/2012/08/gitignore-file/