forked from att-innovate/occam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
64 lines (54 loc) · 1.77 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'net/http'
require 'net/ssh'
require 'net/scp'
require 'securerandom'
require 'yaml'
require 'rspec/core/rake_task'
require 'highline/import'
require 'erb'
# Ruby 1.8.7 doesn't have require_relative
require './lib/tasks/helper.rb'
require './lib/helpers/virtualbox.rb'
require './lib/helpers/net.rb'
ROOT = File.dirname(__FILE__)
ZONEFILE = ENV['ZONEFILE'] || 'zone1' # this is the name of the distributed example zone
BASE_BOX="doctorjnupe/precise64_dhcpclient_on_eth7"
PXE_BOX="steigr/pxe"
DISKS_DIR = "#{ROOT}/.virtualdisks"
DISK_SIZE = 1024 * 200
NUM_DISKS = 1
NUM_COMPS = 3
NAT_SSH_START = 2222
NAT_SUBNET_START = 2
DEMO_VMS = ["ops1", "ctrl1", "monit1"]
( DEMO_VMS << (1..NUM_COMPS).map {|i| "comp#{i}"} ).flatten!
VIRTUALBOX_VERSION="4.3"
VAGRANT_VERSION="1.6"
if ENV['PARALLEL']
begin
require 'parallel_tests/tasks'
rescue LoadError
puts 'Unable to load parallel_tests/tasks gem'
puts 'You may forgot to do bundle install'
puts 'Or it\'s fine, if you\'re trying to bootstrap ops node'
end
end
directory 'tmp'
DEFAULT_KEYNAME='puppet.example.com'
OCCAM_DIR=File.dirname(__FILE__)
OC_ENVIRONMENT = ENV['OC_ENVIRONMENT'] || 'production'
OCCAM_CONFIG_DIR = '/etc/occam'
OCCAM_CONFIG_LOCKFILE = "#{OCCAM_CONFIG_DIR}/already-deployed"
OCCAM_CONFIG_ENVFILE = "#{OCCAM_CONFIG_DIR}/environment"
OCCAM_CONFIG_ZONEFILE = "#{OCCAM_CONFIG_DIR}/zone"
Dir.glob('lib/tasks/*.rake').each {|r| import r }
# import or apps related tasks
Dir.glob('puppet/apps/*/tasks/*.rake').each {|r| import r }
task :default => :spec
desc "Run rspec tests"
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = "--no-drb -r rspec_junit_formatter --format "
t.rspec_opts += "RspecJunitFormatter -o junit.xml "
t.rspec_opts += "--format Fuubar --color spec"
t.pattern = ['spec/*_spec.rb']
end