diff --git a/post-receive-script b/post-receive-script index db8495a..59e4ef5 100755 --- a/post-receive-script +++ b/post-receive-script @@ -38,7 +38,6 @@ if File.exists?(app_dir) system("rm config/production.yml") system("git --git-dir=.git checkout -- config/production.yml") system("git --git-dir=.git pull") - system("echo production > RACK_ENV") # Integrate new config data and rewrite file YAML.write_defaults_to_file("/home/git/apps/#{domain}/config/production.yml", cilantro_config) @@ -49,11 +48,12 @@ else system("mkdir log") system("chmod 777 log") YAML.write_defaults_to_file("/home/git/apps/#{domain}/config/production.yml", YAML.load_file("/home/git/defaults/production.yml")) - system("echo production > RACK_ENV") end +system("echo production > RACK_ENV") + ENV['GIT_DIR'] = "/home/git/repositories/#{domain}.git" if latest_commit - commits_included_gems = !!(`git whatchanged #{latest_commit ? latest_commit+'..HEAD ' : ''}| grep -E "\\W+M\\W+.gems"`.chomp =~ /\.gems/) + commits_included_gems = !!(`git whatchanged #{latest_commit ? latest_commit+'..HEAD ' : ''}| grep -E "\\W+(?:M|A)\\W+.gems"`.chomp =~ /\.gems/) commits_included_migration = !!(`git whatchanged #{latest_commit ? latest_commit+'..HEAD ' : ''}| grep -E "\\\\W+\\