discourse/script/docker_test.rb

17 lines
419 B
Ruby
Raw Normal View History

def run_or_fail(command)
pid = Process.spawn(command)
Process.wait(pid)
exit 1 unless $?.exitstatus == 0
end
unless ENV['NO_UPDATE']
run_or_fail("git remote update")
checkout = ENV['COMMIT_HASH'] || "HEAD"
run_or_fail("git checkout #{checkout}")
run_or_fail("bundle")
end
2017-08-18 11:46:21 +08:00
run_or_fail("bundle exec rake docker:lint") if !ENV["SKIP_LINT"]
run_or_fail("bundle exec rake docker:test") if !ENV["LINT_ONLY"]