This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#112741695] Signed-off-by: Sandy Cash <[email protected]>
- Loading branch information
1 parent
d4796c8
commit d47a6eb
Showing
3 changed files
with
19 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
require 'tmpdir' | ||
require 'timeout' | ||
require 'fileutils' | ||
#!/bin/bash | ||
set -e -x -u | ||
|
||
def system!(cmd) | ||
system(cmd) or raise "Command failed: '#{cmd}'" | ||
end | ||
cd $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.. | ||
vagrant up | ||
echo "===== VAGRANT BOX PROVISIONED AND STARTED =====" | ||
|
||
tmpdir = Dir.mktmpdir | ||
|
||
FileUtils.copy("Vagrantfile", tmpdir) | ||
FileUtils.copy("bin/rsync_workspace_into_vm.sh", tmpdir) | ||
puts "Running vagrant in a temporary folder: #{tmpdir}" | ||
echo "about to ssh to run tests" | ||
date | ||
|
||
build_timeout_in_seconds = 2400 | ||
warden_source_dir = Dir.pwd | ||
Dir.chdir(tmpdir) do | ||
begin | ||
Timeout.timeout(build_timeout_in_seconds) do | ||
system!("vagrant up --provider=virtualbox") | ||
system!("./rsync_workspace_into_vm.sh #{warden_source_dir}") | ||
system!("vagrant ssh -c 'cd ~/workspace && bin/test'") | ||
end | ||
rescue Timeout::Error => e | ||
puts "Build took too long, killing the VM" | ||
raise e | ||
ensure | ||
if ENV["NODESTROY"] | ||
puts "Skipping vagrant destroy" | ||
else | ||
system!("vagrant destroy --force") | ||
end | ||
system!("vagrant status") | ||
end | ||
end | ||
if [ -z ${NOTEST:=} ]; then | ||
vagrant ssh -c "/var/cf-release/src/dea-hm-workspace/src/warden/bin/test" | ||
fi |