This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/script/docker_test.rb
T
Guo Xiang Tan 8e8653a300 Fix conditions.
2017-08-18 12:46:21 +09:00

17 lines
419 B
Ruby

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
run_or_fail("bundle exec rake docker:lint") if !ENV["SKIP_LINT"]
run_or_fail("bundle exec rake docker:test") if !ENV["LINT_ONLY"]