Sha256: 7a700c5684770283c53d1bebb12e137ab6e5c23c57230b87c5ad904cc8d9a7a1

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'pry'
require 'open-uri'

def exec_cmd(cmd)
  puts "[#{Time.now}] now running: #{cmd}"
  puts `#{cmd}`
end

exec_cmd('rm -rf spec/cassettes/*')
exec_cmd('cd vagrant-rancher && vagrant up')

server_offline = true

while server_offline
  begin
    ok = open('http://192.168.123.11:8080/v2-beta').status.include?('OK')
    server_offline = !ok
  rescue
    puts "[#{Time.now}] ... server still offline, sleeping"
  ensure
    sleep(3)
  end
end

exec_cmd('SLEEP_TIME=5 bundle exec rspec')

exec_cmd('cd vagrant-rancher && vagrant halt')
exec_cmd('bundle exec rspec')

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rancher-api-beta-0.8.1 scripts/vcr_record.rb