BuildMaster 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +6 -29
- data/lib/buildmaster.rb +0 -2
- data/lib/buildmaster/ant_driver.rb +13 -12
- data/lib/buildmaster/build_number_file.rb +2 -12
- data/lib/buildmaster/buildnumber +1 -1
- data/lib/buildmaster/cotta.rb +4 -0
- data/lib/buildmaster/cotta/command_error.rb +5 -0
- data/lib/buildmaster/cotta/cotta.rb +35 -0
- data/lib/buildmaster/cotta/cotta_dir.rb +73 -0
- data/lib/buildmaster/cotta/cotta_file.rb +99 -0
- data/lib/buildmaster/cotta/file_not_found_error.rb +13 -0
- data/lib/buildmaster/cotta/in_memory_system.rb +160 -0
- data/lib/buildmaster/cotta/physical_system.rb +64 -0
- data/lib/buildmaster/cvs_driver.rb +5 -13
- data/lib/buildmaster/file_processor.rb +34 -33
- data/lib/buildmaster/java_manifest.rb +3 -3
- data/lib/buildmaster/site/site.rb +11 -22
- data/lib/buildmaster/site_spec.rb +15 -13
- data/lib/buildmaster/source_file_handler.rb +1 -1
- data/lib/buildmaster/svn_driver.rb +14 -20
- data/lib/buildmaster/{template_exception.rb → template_error.rb} +1 -1
- data/lib/buildmaster/template_runner.rb +2 -2
- data/lib/buildmaster/templatelets/attribute.rb +1 -1
- data/lib/buildmaster/templatelets/href.rb +1 -1
- data/lib/buildmaster/templatelets/text.rb +1 -1
- data/lib/buildmaster/templatelets/when.rb +1 -1
- data/lib/buildmaster/windows.rb +3 -0
- data/lib/buildmaster/windows/iis_driver.rb +33 -0
- data/lib/buildmaster/windows/sql_server_driver.rb +27 -0
- data/test/buildmaster/cotta/content.txt +3 -0
- data/test/buildmaster/cotta/cotta_specifications.rb +172 -0
- data/test/buildmaster/cotta/physical_system_stub.rb +85 -0
- data/test/buildmaster/cotta/system_file_specifications.rb +131 -0
- data/test/buildmaster/cotta/tc_cotta.rb +33 -0
- data/test/buildmaster/cotta/tc_cotta_dir_in_memory.rb +23 -0
- data/test/buildmaster/cotta/tc_cotta_dir_physical.rb +17 -0
- data/test/buildmaster/cotta/tc_cotta_file_in_memory.rb +20 -0
- data/test/buildmaster/cotta/tc_cotta_file_physical.rb +17 -0
- data/test/buildmaster/cotta/tc_in_memory_system.rb +25 -0
- data/test/buildmaster/cotta/tc_physical_system.rb +26 -0
- data/test/buildmaster/manifest.mf +1 -1
- data/test/buildmaster/site/tc_site.rb +58 -34
- data/test/buildmaster/site/tc_template_builder.rb +32 -31
- data/test/buildmaster/tc_ant_driver.rb +11 -13
- data/test/buildmaster/tc_build_number_file.rb +21 -16
- data/test/buildmaster/tc_cvs_driver.rb +35 -37
- data/test/buildmaster/tc_file_processor.rb +58 -34
- data/test/buildmaster/tc_java_manifest.rb +37 -9
- data/test/buildmaster/tc_site_spec.rb +20 -15
- data/test/buildmaster/tc_source_file_handler.rb +4 -4
- data/test/buildmaster/tc_svn_driver.rb +51 -38
- data/test/buildmaster/tc_template_runner.rb +19 -18
- data/test/buildmaster/tc_tree_to_object.rb +47 -46
- data/test/buildmaster/tc_xtemplate.rb +52 -38
- data/test/buildmaster/templatelets/common_templatelet_test.rb +9 -8
- data/test/buildmaster/templatelets/tc_attribute.rb +26 -23
- data/test/buildmaster/templatelets/tc_each.rb +27 -26
- data/test/buildmaster/templatelets/tc_href.rb +14 -13
- data/test/buildmaster/templatelets/tc_include.rb +11 -4
- data/test/buildmaster/templatelets/tc_link.rb +18 -12
- data/test/buildmaster/templatelets/tc_text.rb +12 -7
- data/test/buildmaster/templatelets/tc_when.rb +11 -5
- data/test/buildmaster/windows/tc_iis_driver.rb +29 -0
- data/test/buildmaster/windows/tc_sql_server_driver.rb +24 -0
- data/test/spec_runner.rb +27 -0
- data/test/ts_buildmaster.rb +2 -19
- metadata +34 -10
- data/lib/buildmaster/release_control.rb +0 -22
- data/lib/buildmaster/shell_command.rb +0 -39
- data/test/buildmaster/tc_release_control.rb +0 -27
- data/test/buildmaster/ts_site.rb +0 -4
- data/test/buildmaster/ts_templatelets.rb +0 -10
@@ -0,0 +1,24 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
|
2
|
+
|
3
|
+
require 'spec'
|
4
|
+
require 'buildmaster/windows/sql_server_driver'
|
5
|
+
require 'buildmaster/cotta'
|
6
|
+
require 'buildmaster/cotta/in_memory_system'
|
7
|
+
|
8
|
+
module BuildMaster
|
9
|
+
|
10
|
+
context 'Microsoft SQL server driver' do
|
11
|
+
def setup
|
12
|
+
@system = InMemorySystem.new
|
13
|
+
@server = SqlServerDriver.new(Cotta.new(@system))
|
14
|
+
end
|
15
|
+
|
16
|
+
specify 'should control sql server - but need SQL server installed and not running' do
|
17
|
+
@server = SqlServerDriver.new
|
18
|
+
@server.start
|
19
|
+
@server.status
|
20
|
+
@server.stop
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
data/test/spec_runner.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spec'
|
3
|
+
#require 'diff/lcs'
|
4
|
+
dir = File.dirname(__FILE__)
|
5
|
+
#require "#{dir}/../test/common_test_case"
|
6
|
+
require 'test/unit'
|
7
|
+
Test::Unit.run = true
|
8
|
+
|
9
|
+
args = ARGV.dup
|
10
|
+
unless args.include?("-f") || args.include?("--format")
|
11
|
+
args << "--format"
|
12
|
+
args << "specdoc"
|
13
|
+
end
|
14
|
+
#args << "--diff"
|
15
|
+
args << $0
|
16
|
+
$context_runner = ::Spec::Runner::OptionParser.create_context_runner(args, false, STDERR, STDOUT)
|
17
|
+
|
18
|
+
def run_context_runner_if_necessary(system_exit, has_run)
|
19
|
+
return if system_exit && !(system_exit.respond_to?(:success?) && system_exit.success?)
|
20
|
+
return if has_run
|
21
|
+
exit context_runner.run(true)
|
22
|
+
end
|
23
|
+
|
24
|
+
at_exit do
|
25
|
+
has_run = !context_runner.instance_eval {@reporter}.instance_eval {@start_time}.nil?
|
26
|
+
run_context_runner_if_necessary($!, has_run)
|
27
|
+
end
|
data/test/ts_buildmaster.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
$:.unshift(File.dirname(__FILE__))
|
2
|
-
require '
|
2
|
+
require 'spec_runner'
|
3
3
|
|
4
|
-
=
|
5
|
-
require 'buildmaster/tc_ant_driver'
|
6
|
-
require 'buildmaster/tc_build_number_file'
|
7
|
-
require 'buildmaster/tc_cvs_driver'
|
8
|
-
require 'buildmaster/tc_file_processor'
|
9
|
-
require 'buildmaster/tc_java_manifest'
|
10
|
-
require 'buildmaster/tc_release_control'
|
11
|
-
require 'buildmaster/tc_site_spec'
|
12
|
-
require 'buildmaster/tc_source_file_handler'
|
13
|
-
require 'buildmaster/tc_svn_driver'
|
14
|
-
require 'buildmaster/tc_template_runner'
|
15
|
-
require 'buildmaster/tc_tree_to_object'
|
16
|
-
require 'buildmaster/tc_xtemplate'
|
17
|
-
require 'buildmaster/ts_site'
|
18
|
-
require 'buildmaster/ts_templatelets'
|
19
|
-
=end
|
20
|
-
|
21
|
-
root = File.dirname(__FILE__)
|
4
|
+
root = File.join(File.dirname(__FILE__))
|
22
5
|
Dir.glob("#{root}/**/tc_*.rb") do |file|
|
23
6
|
require "#{file}"
|
24
7
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: BuildMaster
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.9.0
|
7
|
+
date: 2006-10-01 00:00:00 -06:00
|
8
8
|
summary: A project that hosts a series of scripts to be used in project building, project releasing, and site building.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -37,12 +37,12 @@ files:
|
|
37
37
|
- lib/buildmaster/buildnumber
|
38
38
|
- lib/buildmaster/build_file.rb
|
39
39
|
- lib/buildmaster/build_number_file.rb
|
40
|
+
- lib/buildmaster/cotta
|
41
|
+
- lib/buildmaster/cotta.rb
|
40
42
|
- lib/buildmaster/cvs_driver.rb
|
41
43
|
- lib/buildmaster/file_processor.rb
|
42
44
|
- lib/buildmaster/java_manifest.rb
|
43
|
-
- lib/buildmaster/release_control.rb
|
44
45
|
- lib/buildmaster/run_ant.rb
|
45
|
-
- lib/buildmaster/shell_command.rb
|
46
46
|
- lib/buildmaster/site
|
47
47
|
- lib/buildmaster/site_server.rb
|
48
48
|
- lib/buildmaster/site_spec.rb
|
@@ -52,11 +52,20 @@ files:
|
|
52
52
|
- lib/buildmaster/svn_driver.rb
|
53
53
|
- lib/buildmaster/templatelets
|
54
54
|
- lib/buildmaster/templatelets.rb
|
55
|
-
- lib/buildmaster/
|
55
|
+
- lib/buildmaster/template_error.rb
|
56
56
|
- lib/buildmaster/template_runner.rb
|
57
57
|
- lib/buildmaster/tree_to_object.rb
|
58
58
|
- lib/buildmaster/try.rb
|
59
|
+
- lib/buildmaster/windows
|
60
|
+
- lib/buildmaster/windows.rb
|
59
61
|
- lib/buildmaster/xtemplate.rb
|
62
|
+
- lib/buildmaster/cotta/command_error.rb
|
63
|
+
- lib/buildmaster/cotta/cotta.rb
|
64
|
+
- lib/buildmaster/cotta/cotta_dir.rb
|
65
|
+
- lib/buildmaster/cotta/cotta_file.rb
|
66
|
+
- lib/buildmaster/cotta/file_not_found_error.rb
|
67
|
+
- lib/buildmaster/cotta/in_memory_system.rb
|
68
|
+
- lib/buildmaster/cotta/physical_system.rb
|
60
69
|
- lib/buildmaster/site/site.rb
|
61
70
|
- lib/buildmaster/site/template
|
62
71
|
- lib/buildmaster/site/template_builder.rb
|
@@ -69,11 +78,15 @@ files:
|
|
69
78
|
- lib/buildmaster/templatelets/link.rb
|
70
79
|
- lib/buildmaster/templatelets/text.rb
|
71
80
|
- lib/buildmaster/templatelets/when.rb
|
81
|
+
- lib/buildmaster/windows/iis_driver.rb
|
82
|
+
- lib/buildmaster/windows/sql_server_driver.rb
|
72
83
|
- lib/mock/mock_base.rb
|
73
84
|
- test/buildmaster
|
85
|
+
- test/spec_runner.rb
|
74
86
|
- test/tmp
|
75
87
|
- test/ts_buildmaster.rb
|
76
88
|
- test/buildmaster/build.xml
|
89
|
+
- test/buildmaster/cotta
|
77
90
|
- test/buildmaster/manifest.mf
|
78
91
|
- test/buildmaster/site
|
79
92
|
- test/buildmaster/tc_ant_driver.rb
|
@@ -81,7 +94,6 @@ files:
|
|
81
94
|
- test/buildmaster/tc_cvs_driver.rb
|
82
95
|
- test/buildmaster/tc_file_processor.rb
|
83
96
|
- test/buildmaster/tc_java_manifest.rb
|
84
|
-
- test/buildmaster/tc_release_control.rb
|
85
97
|
- test/buildmaster/tc_site_spec.rb
|
86
98
|
- test/buildmaster/tc_source_file_handler.rb
|
87
99
|
- test/buildmaster/tc_svn_driver.rb
|
@@ -90,8 +102,18 @@ files:
|
|
90
102
|
- test/buildmaster/tc_xtemplate.rb
|
91
103
|
- test/buildmaster/template.xhtml
|
92
104
|
- test/buildmaster/templatelets
|
93
|
-
- test/buildmaster/
|
94
|
-
- test/buildmaster/
|
105
|
+
- test/buildmaster/windows
|
106
|
+
- test/buildmaster/cotta/content.txt
|
107
|
+
- test/buildmaster/cotta/cotta_specifications.rb
|
108
|
+
- test/buildmaster/cotta/physical_system_stub.rb
|
109
|
+
- test/buildmaster/cotta/system_file_specifications.rb
|
110
|
+
- test/buildmaster/cotta/tc_cotta.rb
|
111
|
+
- test/buildmaster/cotta/tc_cotta_dir_in_memory.rb
|
112
|
+
- test/buildmaster/cotta/tc_cotta_dir_physical.rb
|
113
|
+
- test/buildmaster/cotta/tc_cotta_file_in_memory.rb
|
114
|
+
- test/buildmaster/cotta/tc_cotta_file_physical.rb
|
115
|
+
- test/buildmaster/cotta/tc_in_memory_system.rb
|
116
|
+
- test/buildmaster/cotta/tc_physical_system.rb
|
95
117
|
- test/buildmaster/site/content
|
96
118
|
- test/buildmaster/site/tc_site.rb
|
97
119
|
- test/buildmaster/site/tc_template_builder.rb
|
@@ -106,13 +128,15 @@ files:
|
|
106
128
|
- test/buildmaster/templatelets/tc_link.rb
|
107
129
|
- test/buildmaster/templatelets/tc_text.rb
|
108
130
|
- test/buildmaster/templatelets/tc_when.rb
|
131
|
+
- test/buildmaster/windows/tc_iis_driver.rb
|
132
|
+
- test/buildmaster/windows/tc_sql_server_driver.rb
|
109
133
|
- test/tmp/output
|
110
134
|
- test/tmp/output/index.html
|
111
135
|
- test/tmp/output/markdown.html
|
112
136
|
- test/tmp/output/textile.html
|
113
137
|
- README
|
114
|
-
test_files:
|
115
|
-
|
138
|
+
test_files: []
|
139
|
+
|
116
140
|
rdoc_options: []
|
117
141
|
|
118
142
|
extra_rdoc_files:
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module BuildMaster
|
2
|
-
|
3
|
-
class Release
|
4
|
-
def initialize(vcs_driver, builder)
|
5
|
-
@vcs_driver = vcs_driver
|
6
|
-
@builder = builder
|
7
|
-
end
|
8
|
-
|
9
|
-
def release_candidate(tag)
|
10
|
-
@vcs_driver.checkout
|
11
|
-
@vcs_driver.tag(tag)
|
12
|
-
@builder.build
|
13
|
-
@vcs_driver.commit
|
14
|
-
end
|
15
|
-
|
16
|
-
def release_rebuild(tag)
|
17
|
-
@vcs_driver.checkout(tag)
|
18
|
-
@builder.invoke
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Shell
|
2
|
-
private
|
3
|
-
def run(command)
|
4
|
-
puts "--> #{command}"
|
5
|
-
if (!system(command))
|
6
|
-
raise "error running command: #{command}"
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def run_command(full_command)
|
11
|
-
if (@command_runner)
|
12
|
-
@command_runner.call(full_command)
|
13
|
-
else
|
14
|
-
run(full_command)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def check_directory(path)
|
19
|
-
raise "#{path} is not a directory" unless File.directory? path
|
20
|
-
return path
|
21
|
-
end
|
22
|
-
|
23
|
-
def get_environment(name)
|
24
|
-
value = ENV[name]
|
25
|
-
raise "#{name} is not set" unless value
|
26
|
-
return value
|
27
|
-
end
|
28
|
-
|
29
|
-
def get_environment_or_default(name, default_value='')
|
30
|
-
value = ENV[name]
|
31
|
-
value = default_value if not value
|
32
|
-
return value
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
class SystemCommandRunner
|
38
|
-
|
39
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib")
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'buildmaster'
|
5
|
-
require 'mock'
|
6
|
-
|
7
|
-
module BuildMaster
|
8
|
-
|
9
|
-
class ReleaseTest < Test::Unit::TestCase
|
10
|
-
def testRelease
|
11
|
-
cvs_mock = Mock.new(CvsDriver)
|
12
|
-
cvs_mock.expects(:checkout)
|
13
|
-
cvs_mock.expects(:tag)
|
14
|
-
cvs_mock.expects(:commit)
|
15
|
-
|
16
|
-
builder_mock = Mock.new
|
17
|
-
builder_mock.expects(:build)
|
18
|
-
|
19
|
-
release = Release.new(cvs_mock, builder_mock)
|
20
|
-
release.release_candidate('tag')
|
21
|
-
|
22
|
-
cvs_mock.verify
|
23
|
-
builder_mock.verify
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
data/test/buildmaster/ts_site.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__))
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
require 'templatelets/tc_attribute'
|
5
|
-
require 'templatelets/tc_each'
|
6
|
-
require 'templatelets/tc_href'
|
7
|
-
require 'templatelets/tc_include'
|
8
|
-
require 'templatelets/tc_link'
|
9
|
-
require 'templatelets/tc_text'
|
10
|
-
require 'templatelets/tc_when'
|