1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

開発用ディレクトリーとチェック用ディレクトリーをすばやく切り替える方法は?

Posted at

なんか要求が特殊で誰とも合わない気もしますが、取り敢えず貼ってみます。

開発用のディレクトリーにいて、ApacheのDocumentRootも含んでいて、開発中はこのリポジトリーで作業します。
ノンプログラマーにチェックしてもらうために、隣のディレクトリー(以下では../check)にチェック用のディレクトリーを作って、そこもApacheで、別のホスト名で確認できるようにしておきます。

「あるブランチをノンプログラマーに動作確認してほしいけど、
 自分は別のブランチで開発を進めていたい」
という要求から書きました。

きれいな解決策じゃないので、何かいいツールがあれば教えてもらえると嬉しいです!

Rakefile
desc 'チェック用リポジトリーのブランチを切り替えます'
task :checkrepo, [:branch] do |t, args|
 if args[:branch].nil? || args[:branch].empty?
   $stderr.puts 'ブランチ名を指定してください'
   $stderr.puts '使い方:rake checkrepo[branchname]'
   exit!
 end

 Dir.chdir '../check' do
   unless system("git checkout #{args[:branch]}")
     $stderr.puts "ブランチ #{args[:branch]} に切り替えられませんでした"
     $stderr.puts `git branch`
     exit!
   end

   sh 'git pull'
   Rake::Task['scss:update'].invoke
 end
end

普通はどうしているんですかねえ。
チェック用ブランチを特別に作って、チェック用サーバーを立てて、そこで確認?
それだと機能ブランチ単位での確認ができないんですよねえ。
マージはSubversionよりだいぶ楽とはいえ、やっぱり不要ならやりたくない。

週明けにはIRCチャンネルに通知する部分も追記しようと思います。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?