diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake index f3431e303af..041a5ecf195 100644 --- a/lib/tasks/docker.rake +++ b/lib/tasks/docker.rake @@ -9,14 +9,16 @@ desc 'Run all tests (JS and code in a standalone environment)' task 'docker:test' do begin - exit 1 unless run_or_fail("git remote update") + unless ENV['NO_UPDATE'] + exit 1 unless run_or_fail("git remote update") - checkout = "master" - if hash = ENV['COMMIT_HASH'] - checkout = hash + checkout = "master" + if hash = ENV['COMMIT_HASH'] + checkout = hash + end + exit 1 unless run_or_fail("git checkout #{checkout}") + exit 1 unless run_or_fail("bundle") end - exit 1 unless run_or_fail("git checkout #{checkout}") - exit 1 unless run_or_fail("bundle") puts "Cleaning up old test tmp data in tmp/test_data" `rm -fr tmp/test_data && mkdir -p tmp/test_data/redis && mkdir tmp/test_data/pg` @@ -27,6 +29,12 @@ task 'docker:test' do @postgres_bin = "/usr/lib/postgresql/9.3/bin/" `#{@postgres_bin}initdb -D tmp/test_data/pg` + # speed up db, never do this in production mmmmk + `echo fsync = off >> tmp/test_data/pg/postgresql.conf` + `echo full_page_writes = off >> tmp/test_data/pg/postgresql.conf` + `echo shared_buffers = 500MB >> tmp/test_data/pg/postgresql.conf` + + puts "Starting postgres" @pg_pid = Process.spawn("#{@postgres_bin}postmaster -D tmp/test_data/pg")