bozo-scripts 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/bozo/compilers/msbuild.rb +13 -5
- data/lib/bozo/packagers/nuget.rb +24 -19
- metadata +25 -8
- checksums.yaml +0 -15
- data/lib/bozo/preparers/sql_server.rb~ +0 -93
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
@@ -17,7 +17,7 @@ module Bozo::Compilers
|
|
17
17
|
|
18
18
|
config = defaults.merge @config
|
19
19
|
config[:targets] = (@targets or default_targets).clone
|
20
|
-
config[:websites_as_zip]
|
20
|
+
config[:websites_as_zip] ||= false
|
21
21
|
config
|
22
22
|
end
|
23
23
|
|
@@ -47,7 +47,7 @@ module Bozo::Compilers
|
|
47
47
|
@exclude_projects << project_name
|
48
48
|
end
|
49
49
|
|
50
|
-
def websites_as_zip
|
50
|
+
def websites_as_zip
|
51
51
|
@config[:websites_as_zip] = true
|
52
52
|
end
|
53
53
|
|
@@ -207,8 +207,12 @@ module Bozo::Compilers
|
|
207
207
|
path.gsub(/\//, '\\')
|
208
208
|
end
|
209
209
|
|
210
|
+
def temp_project_path
|
211
|
+
File.expand_path(File.join('temp', 'msbuild', @project_name))
|
212
|
+
end
|
213
|
+
|
210
214
|
def location
|
211
|
-
File.expand_path(File.join(
|
215
|
+
File.expand_path(File.join(temp_project_path, framework_version))
|
212
216
|
end
|
213
217
|
|
214
218
|
private
|
@@ -244,8 +248,12 @@ module Bozo::Compilers
|
|
244
248
|
def populate_config(config)
|
245
249
|
config[:targets] << :package
|
246
250
|
|
247
|
-
config[:
|
248
|
-
|
251
|
+
if config[:websites_as_zip]
|
252
|
+
config[:properties][:packagelocation] = location + '/Site.zip'
|
253
|
+
config[:properties][:packageassinglefile] = true
|
254
|
+
else
|
255
|
+
config[:properties][:_packagetempdir] = temp_project_path
|
256
|
+
end
|
249
257
|
|
250
258
|
config[:properties][:solutiondir] = windowsize_path(File.expand_path('.') + '//')
|
251
259
|
end
|
data/lib/bozo/packagers/nuget.rb
CHANGED
@@ -3,21 +3,25 @@ require 'nokogiri'
|
|
3
3
|
module Bozo::Packagers
|
4
4
|
|
5
5
|
class Nuget
|
6
|
-
|
6
|
+
|
7
7
|
def initialize
|
8
8
|
@libraries = []
|
9
9
|
@executables = []
|
10
10
|
@websites = []
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def destination(destination)
|
14
14
|
@destination = destination
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def library(project, *extfiles)
|
18
18
|
@libraries << LibraryPackage.new(project, extfiles, self)
|
19
19
|
end
|
20
20
|
|
21
|
+
def library_with_option(project, opts = {})
|
22
|
+
@libraries << LibraryPackage.new(project, opts[:extfiles], self, opts[:excluded_references])
|
23
|
+
end
|
24
|
+
|
21
25
|
def executable(project)
|
22
26
|
@executables << ExecutablePackage.new(project)
|
23
27
|
end
|
@@ -25,7 +29,7 @@ module Bozo::Packagers
|
|
25
29
|
def website(project)
|
26
30
|
@websites << WebsitePackage.new(project)
|
27
31
|
end
|
28
|
-
|
32
|
+
|
29
33
|
def required_tools
|
30
34
|
:nuget
|
31
35
|
end
|
@@ -41,11 +45,11 @@ module Bozo::Packagers
|
|
41
45
|
def author(author)
|
42
46
|
@author = author
|
43
47
|
end
|
44
|
-
|
48
|
+
|
45
49
|
def to_s
|
46
50
|
"Publish projects with nuget #{@libraries | @executables | @websites} to #{@destination}"
|
47
51
|
end
|
48
|
-
|
52
|
+
|
49
53
|
def execute
|
50
54
|
@libraries.each {|project| package project}
|
51
55
|
@executables.each {|project| package project}
|
@@ -63,7 +67,7 @@ module Bozo::Packagers
|
|
63
67
|
spec_path = generate_specification(project)
|
64
68
|
create_package(project.name, spec_path, true)
|
65
69
|
end
|
66
|
-
|
70
|
+
|
67
71
|
def generate_specification(project)
|
68
72
|
log_debug "Generating specification for #{project.name}"
|
69
73
|
builder = Nokogiri::XML::Builder.new do |doc|
|
@@ -93,27 +97,27 @@ module Bozo::Packagers
|
|
93
97
|
File.open(spec_path, 'w+') {|f| f.write(builder.to_xml)}
|
94
98
|
spec_path
|
95
99
|
end
|
96
|
-
|
100
|
+
|
97
101
|
def create_package(project, spec_path, omit_analysis = false)
|
98
102
|
args = []
|
99
|
-
|
103
|
+
|
100
104
|
dist_dir = File.expand_path(File.join('dist', 'nuget'))
|
101
|
-
|
105
|
+
|
102
106
|
args << File.expand_path(File.join('build', 'tools', 'nuget', 'NuGet.exe'))
|
103
107
|
args << 'pack'
|
104
108
|
args << "\"#{spec_path}\""
|
105
109
|
args << '-OutputDirectory'
|
106
110
|
args << "\"#{dist_dir}\""
|
107
111
|
args << '-NoPackageAnalysis' if omit_analysis
|
108
|
-
|
112
|
+
|
109
113
|
# Ensure the directory is there because Nuget won't make it
|
110
114
|
FileUtils.mkdir_p dist_dir
|
111
|
-
|
115
|
+
|
112
116
|
log_debug "Creating nuget package for #{project}"
|
113
|
-
|
117
|
+
|
114
118
|
execute_command :nuget, args
|
115
119
|
end
|
116
|
-
|
120
|
+
|
117
121
|
end
|
118
122
|
|
119
123
|
private
|
@@ -133,17 +137,18 @@ module Bozo::Packagers
|
|
133
137
|
end
|
134
138
|
|
135
139
|
def files
|
136
|
-
[{:src => File.expand_path(File.join('temp', 'msbuild', @name, '**', '*.*')).gsub(/\//, '\\')
|
140
|
+
[{:src => File.expand_path(File.join('temp', 'msbuild', @name, '**', '*.*')).gsub(/\//, '\\')}]
|
137
141
|
end
|
138
142
|
|
139
143
|
end
|
140
144
|
|
141
145
|
class LibraryPackage
|
142
146
|
|
143
|
-
def initialize(project, extfiles, nuget)
|
147
|
+
def initialize(project, extfiles, nuget, excluded_references = [])
|
144
148
|
@name = project
|
145
149
|
@nuget = nuget
|
146
150
|
@extfiles = extfiles
|
151
|
+
@excluded_references = excluded_references
|
147
152
|
end
|
148
153
|
|
149
154
|
def name
|
@@ -186,7 +191,7 @@ module Bozo::Packagers
|
|
186
191
|
doc = Nokogiri::XML(File.open(package_file))
|
187
192
|
|
188
193
|
doc.xpath('//packages/package').map do |node|
|
189
|
-
{:id => node[:id], :version => "[#{node[:version]}]"}
|
194
|
+
{:id => node[:id], :version => "[#{node[:version]}]"} unless @excluded_references.include? node[:id]
|
190
195
|
end
|
191
196
|
end
|
192
197
|
|
@@ -221,9 +226,9 @@ module Bozo::Packagers
|
|
221
226
|
end
|
222
227
|
|
223
228
|
def files
|
224
|
-
[{:src => File.expand_path(File.join('temp', 'msbuild', @name, '**', '*.*')).gsub(/\//, '\\')
|
229
|
+
[{:src => File.expand_path(File.join('temp', 'msbuild', @name, '**', '*.*')).gsub(/\//, '\\')}]
|
225
230
|
end
|
226
231
|
|
227
232
|
end
|
228
|
-
|
233
|
+
|
229
234
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bozo-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Garry Shutler
|
@@ -9,11 +10,12 @@ authors:
|
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2015-
|
13
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: nokogiri
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
17
19
|
requirements:
|
18
20
|
- - ~>
|
19
21
|
- !ruby/object:Gem::Version
|
@@ -21,6 +23,7 @@ dependencies:
|
|
21
23
|
type: :runtime
|
22
24
|
prerelease: false
|
23
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - ~>
|
26
29
|
- !ruby/object:Gem::Version
|
@@ -28,6 +31,7 @@ dependencies:
|
|
28
31
|
- !ruby/object:Gem::Dependency
|
29
32
|
name: erubis
|
30
33
|
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
31
35
|
requirements:
|
32
36
|
- - ~>
|
33
37
|
- !ruby/object:Gem::Version
|
@@ -35,6 +39,7 @@ dependencies:
|
|
35
39
|
type: :runtime
|
36
40
|
prerelease: false
|
37
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
38
43
|
requirements:
|
39
44
|
- - ~>
|
40
45
|
- !ruby/object:Gem::Version
|
@@ -42,6 +47,7 @@ dependencies:
|
|
42
47
|
- !ruby/object:Gem::Dependency
|
43
48
|
name: test-unit
|
44
49
|
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
45
51
|
requirements:
|
46
52
|
- - ~>
|
47
53
|
- !ruby/object:Gem::Version
|
@@ -49,6 +55,7 @@ dependencies:
|
|
49
55
|
type: :runtime
|
50
56
|
prerelease: false
|
51
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
52
59
|
requirements:
|
53
60
|
- - ~>
|
54
61
|
- !ruby/object:Gem::Version
|
@@ -56,6 +63,7 @@ dependencies:
|
|
56
63
|
- !ruby/object:Gem::Dependency
|
57
64
|
name: bozo
|
58
65
|
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
59
67
|
requirements:
|
60
68
|
- - ~>
|
61
69
|
- !ruby/object:Gem::Version
|
@@ -63,6 +71,7 @@ dependencies:
|
|
63
71
|
type: :runtime
|
64
72
|
prerelease: false
|
65
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
66
75
|
requirements:
|
67
76
|
- - ~>
|
68
77
|
- !ruby/object:Gem::Version
|
@@ -70,6 +79,7 @@ dependencies:
|
|
70
79
|
- !ruby/object:Gem::Dependency
|
71
80
|
name: zip
|
72
81
|
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
73
83
|
requirements:
|
74
84
|
- - ~>
|
75
85
|
- !ruby/object:Gem::Version
|
@@ -77,6 +87,7 @@ dependencies:
|
|
77
87
|
type: :runtime
|
78
88
|
prerelease: false
|
79
89
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
80
91
|
requirements:
|
81
92
|
- - ~>
|
82
93
|
- !ruby/object:Gem::Version
|
@@ -89,8 +100,6 @@ executables: []
|
|
89
100
|
extensions: []
|
90
101
|
extra_rdoc_files: []
|
91
102
|
files:
|
92
|
-
- LICENSE
|
93
|
-
- VERSION
|
94
103
|
- lib/bozo/compilers/msbuild.rb
|
95
104
|
- lib/bozo/configuration.rb
|
96
105
|
- lib/bozo/dependency_resolvers/bundler.rb
|
@@ -110,7 +119,6 @@ files:
|
|
110
119
|
- lib/bozo/preparers/common_assembly_info.rb
|
111
120
|
- lib/bozo/preparers/file_templating.rb
|
112
121
|
- lib/bozo/preparers/sql_server.rb
|
113
|
-
- lib/bozo/preparers/sql_server.rb~
|
114
122
|
- lib/bozo/publishers/file_copy.rb
|
115
123
|
- lib/bozo/publishers/nuget.rb
|
116
124
|
- lib/bozo/publishers/rubygems.rb
|
@@ -122,27 +130,36 @@ files:
|
|
122
130
|
- lib/bozo/tools/opencover.rb
|
123
131
|
- lib/bozo/version.rb
|
124
132
|
- lib/bozo_scripts.rb
|
133
|
+
- VERSION
|
134
|
+
- LICENSE
|
125
135
|
homepage: https://github.com/zopaUK/bozo-scripts
|
126
136
|
licenses: []
|
127
|
-
metadata: {}
|
128
137
|
post_install_message:
|
129
138
|
rdoc_options: []
|
130
139
|
require_paths:
|
131
140
|
- lib
|
132
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
133
143
|
requirements:
|
134
144
|
- - ! '>='
|
135
145
|
- !ruby/object:Gem::Version
|
136
146
|
version: '0'
|
147
|
+
segments:
|
148
|
+
- 0
|
149
|
+
hash: 1042312893
|
137
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
none: false
|
138
152
|
requirements:
|
139
153
|
- - ! '>='
|
140
154
|
- !ruby/object:Gem::Version
|
141
155
|
version: '0'
|
156
|
+
segments:
|
157
|
+
- 0
|
158
|
+
hash: 1042312893
|
142
159
|
requirements: []
|
143
160
|
rubyforge_project: bozo-scripts
|
144
|
-
rubygems_version:
|
161
|
+
rubygems_version: 1.8.29
|
145
162
|
signing_key:
|
146
|
-
specification_version:
|
163
|
+
specification_version: 3
|
147
164
|
summary: Zopa build system scripts
|
148
165
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
NWM1NGNlOTgzNTVjZmM3NzkyMjE1YjZkODkyYmFkMzQwMDI4YmNlZQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OTJiODk1OWFmN2JkYjI0YjIxMGI3YTFiM2EwZWY1ZGM3NGUxMGRkMA==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
OTZhOTk2M2UxYmVhYjgzMDE3N2FlMWMzNzRjMGRkMzQxZTA0YmViZWZkNTlh
|
10
|
-
MTYyMzBmY2RjZTBhZTY0OTMxNDZlMzRlYjAwMjdlNzU0YzRlZGIyZDkyYjRh
|
11
|
-
ZTgyMmQ0NmI2NjkwNDI0MjdjNzQzZGY2OWRkMzFmY2U5NDk4MmQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NDY2Y2NiYTgyNzY0ODE0Y2FlYmYyMzBhOGQzM2RlY2U5YWZiMDRkNGY0NGFh
|
14
|
-
ODEwMzFkMjM4NWEwZDFlNWVjMWM2YWUyYWRhZjg0MGQzYWYyNzQwNmMwZTA5
|
15
|
-
MDg2NWQzNWRhNjRjOWI1YTk0ZWQ2ODQ1N2VkZWM1NzMyZjk0OWM=
|
@@ -1,93 +0,0 @@
|
|
1
|
-
module Bozo::Preparers
|
2
|
-
|
3
|
-
# Executes a sql script
|
4
|
-
#
|
5
|
-
# == Hook configuration
|
6
|
-
#
|
7
|
-
# prepare :sql_server do |t|
|
8
|
-
# t.variable 'DatabaseName', 'MyDatabase'
|
9
|
-
# t.variable 'MySecondVariable', 'HelloWorld'
|
10
|
-
# t.script 'my/specific/script.sql' # must be a specific file
|
11
|
-
# t.connection_string { |c| c[:config_value] } # a function taking the configuration as an argument
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# The variables are accessible via `$(KEY)` in the sql script.
|
15
|
-
class SqlServer
|
16
|
-
|
17
|
-
def execute
|
18
|
-
configuration = load_config
|
19
|
-
|
20
|
-
execute_command :sqlcmd, generate_args(configuration)
|
21
|
-
end
|
22
|
-
|
23
|
-
def variable(key, value)
|
24
|
-
@variables ||= {}
|
25
|
-
@variables[key] = value
|
26
|
-
end
|
27
|
-
|
28
|
-
def script(value)
|
29
|
-
@script = value
|
30
|
-
end
|
31
|
-
|
32
|
-
def database_name(name)
|
33
|
-
@database_name = name
|
34
|
-
end
|
35
|
-
|
36
|
-
def connection_string(&value)
|
37
|
-
@connection_string = value
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def generate_args(configuration)
|
43
|
-
connection_string = @connection_string.call(configuration)
|
44
|
-
|
45
|
-
if connection_string.nil? || connection_string.length == 0
|
46
|
-
raise Exception.new('No connection string specified')
|
47
|
-
end
|
48
|
-
|
49
|
-
args = []
|
50
|
-
args << 'sqlcmd'
|
51
|
-
args << "-S #{connection_string}"
|
52
|
-
args << "-i #{@script}"
|
53
|
-
@variables.each do |key, value|
|
54
|
-
args << "-v #{key}=#{value}"
|
55
|
-
end
|
56
|
-
|
57
|
-
args
|
58
|
-
end
|
59
|
-
|
60
|
-
def load_config
|
61
|
-
default_files = ['default.rb', "#{environment}.rb"]
|
62
|
-
default_files << "#{env['MACHINENAME']}.rb" if env['MACHINENAME']
|
63
|
-
|
64
|
-
configuration = Bozo::Configuration.new
|
65
|
-
|
66
|
-
default_files.each do |file|
|
67
|
-
path = File.join('config', file)
|
68
|
-
configuration.load path if File.exist? path
|
69
|
-
end
|
70
|
-
|
71
|
-
configuration
|
72
|
-
end
|
73
|
-
|
74
|
-
def default_script
|
75
|
-
<<-SQL
|
76
|
-
IF EXISTS(select * from sys.databases where name='#{@database_name}')
|
77
|
-
BEGIN
|
78
|
-
-- handle when the database cannot be dropped because it is currently in use
|
79
|
-
ALTER DATABASE #{@database_name} SET SINGLE_USER WITH ROLLBACK IMMEDIATE
|
80
|
-
|
81
|
-
DROP DATABASE #{@database_name}
|
82
|
-
END
|
83
|
-
GO
|
84
|
-
|
85
|
-
-- Create DB
|
86
|
-
CREATE DATABASE [#{@database_name}]
|
87
|
-
GO
|
88
|
-
SQL
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|