azdeploy 1.0.34 → 1.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/azdeploy.gemspec +2 -2
- data/lib/build.rb +25 -24
- data/test/test_azdeploy.rb +0 -2
- data/test/test_versioning.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 378e7e404c9f2c5a67fd250789ac6df3ef308571
|
4
|
+
data.tar.gz: 6bbf09de06cc89a0cfaf3502ff6f37b3bd819182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cfbeac330de7f8a33023562ff3a3865f80e24b15286c443fb2bf3d88fd2852585287f569b2d685c4fc9303ef52123bf51c2fe73b07663f96e619a60fe92cb99
|
7
|
+
data.tar.gz: 6d0ea7140fd9dc78ecbcf15d594aba5e70fcf141ff4afc0dc2040727478e0135c14b0d59a284372001cdf7d4110b8707db2116f9b9baa504ed58788ac186c220
|
data/azdeploy.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'azdeploy'
|
3
|
-
s.version = '1.0.
|
4
|
-
s.date = '
|
3
|
+
s.version = '1.0.35'
|
4
|
+
s.date = '2016-01-06'
|
5
5
|
s.summary = 'Setup and scripting support for .Net project builds'
|
6
6
|
s.description = 'Azure Deployment Gem. Provides easy setup and deployment scripting support for .Net project builds'
|
7
7
|
s.authors = ['Suresh Batta']
|
data/lib/build.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
$versionMap = {}
|
2
|
+
VERSIONING = 'versioning'
|
2
3
|
|
3
|
-
def copy_output_files
|
4
|
+
def copy_output_files fromDir, filePattern, outDir
|
4
5
|
FileUtils.mkdir_p outDir unless exists?(outDir)
|
5
6
|
Dir.glob(File.join(fromDir, filePattern)){|file|
|
6
7
|
copy(file, outDir) if File.file?(file)
|
7
8
|
}
|
8
9
|
end
|
9
10
|
|
10
|
-
def project_outputs
|
11
|
+
def project_outputs props
|
11
12
|
props[:projects].map{ |p| "src/#{p}/bin/#{BUILD_CONFIG}/#{p}.dll" }.
|
12
13
|
concat( props[:projects].map{ |p| "src/#{p}/bin/#{BUILD_CONFIG}/#{p}.exe" } ).
|
13
14
|
find_all{ |path| exists?(path) }
|
@@ -47,7 +48,7 @@ def commit_data
|
|
47
48
|
[commit, commit_date]
|
48
49
|
end
|
49
50
|
|
50
|
-
def waitfor
|
51
|
+
def waitfor &block
|
51
52
|
checks = 0
|
52
53
|
|
53
54
|
until block.call || checks >10
|
@@ -58,7 +59,7 @@ def waitfor(&block)
|
|
58
59
|
raise 'Waitfor timeout expired. Make sure that you aren\'t running something from the build output folders, or that you have browsed to it through Explorer.' if checks > 10
|
59
60
|
end
|
60
61
|
|
61
|
-
def cleantask
|
62
|
+
def cleantask props
|
62
63
|
|
63
64
|
if props.has_key?(:output) && File.directory?(props[:output])
|
64
65
|
FileUtils.rm_rf props[:output]
|
@@ -78,12 +79,12 @@ def cleantask(props)
|
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
81
|
-
def restore_nuget
|
82
|
+
def restore_nuget nuget_exe
|
82
83
|
sh 'powershell', '-Command', "& { Invoke-RestMethod https://www.nuget.org/nuget.exe -OutFile '#{Dir.pwd}/#{nuget_exe}' }"
|
83
84
|
sh "#{Dir.pwd}/#{nuget_exe}", 'restore', "src/#{PRODUCT}.sln"
|
84
85
|
end
|
85
86
|
|
86
|
-
def restore_project_pkgs
|
87
|
+
def restore_project_pkgs proj
|
87
88
|
msbuild :nuget_restore do |msb|
|
88
89
|
msb.use :net4
|
89
90
|
msb.targets :RestorePackages
|
@@ -91,7 +92,7 @@ def restore_project_pkgs(proj)
|
|
91
92
|
end
|
92
93
|
end
|
93
94
|
|
94
|
-
def clean_build
|
95
|
+
def clean_build msb, solution
|
95
96
|
msb.properties :Configuration => 'Release',
|
96
97
|
:Platform => 'Any CPU',
|
97
98
|
:VisualStudioVersion => '12.0'
|
@@ -100,7 +101,7 @@ def clean_build(msb, solution)
|
|
100
101
|
end
|
101
102
|
|
102
103
|
def versioning project=nil, file=nil
|
103
|
-
if
|
104
|
+
if !project.nil? && !file.nil?
|
104
105
|
v = SemVer.new
|
105
106
|
path = File.join VERSIONING, file
|
106
107
|
v.load path
|
@@ -110,7 +111,7 @@ def versioning project=nil, file=nil
|
|
110
111
|
ENV["#{project}_NUGET_VERSION"] = ver.format('%M.%m.%p%s')
|
111
112
|
|
112
113
|
# extensible number w/ git hash
|
113
|
-
ENV["#{project}_BUILD_VERSION"] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
|
114
|
+
ENV["#{project}_BUILD_VERSION"] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
|
114
115
|
|
115
116
|
# purely M.m.p format
|
116
117
|
sem = SemVer.new(ver.major, ver.minor, ver.patch).format '%M.%m.%p'
|
@@ -120,7 +121,7 @@ def versioning project=nil, file=nil
|
|
120
121
|
ver = SemVer.find
|
121
122
|
|
122
123
|
commitData = commit_data()
|
123
|
-
|
124
|
+
|
124
125
|
build_counter = (ENV['BUILD_COUNTER'] || '0').to_i
|
125
126
|
|
126
127
|
# extensible number w/ git hash
|
@@ -134,7 +135,7 @@ def versioning project=nil, file=nil
|
|
134
135
|
ENV['PLATFORM_BUILD_VERSION'] = $versionMap[:platform_build_version] = Time.new.strftime('%y.%-m.%-d') + ".#{commitData[0]}"
|
135
136
|
|
136
137
|
sem = SemVer.new(ver.major, ver.minor, ver.patch).format '%M.%m.%p'
|
137
|
-
|
138
|
+
|
138
139
|
ENV['FORMAL_VERSION'] = $versionMap[:formal_version] = "#{sem}.#{build_counter}"
|
139
140
|
|
140
141
|
teamcity_build_number
|
@@ -147,15 +148,15 @@ def teamcity_build_number
|
|
147
148
|
puts "##teamcity[buildNumber '#{platform_version}']"
|
148
149
|
end
|
149
150
|
|
150
|
-
def set_framework_version
|
151
|
+
def set_framework_version asm
|
151
152
|
set_version asm, $versionMap[:formal_version], $versionMap[:formal_version], $versionMap[:build_version], 'Framework'
|
152
153
|
end
|
153
154
|
|
154
|
-
def set_solution_version
|
155
|
+
def set_solution_version asm
|
155
156
|
set_version asm, $versionMap[:platform_version], $versionMap[:platform_version], $versionMap[:platform_build_version], 'Solution'
|
156
157
|
end
|
157
158
|
|
158
|
-
def set_version
|
159
|
+
def set_version asm, version, file_version, assembly_version, output_file, output_file_src='src'
|
159
160
|
# Assembly file config
|
160
161
|
asm.product_name = PRODUCT
|
161
162
|
asm.description = PRODUCT_DESCRIPTION
|
@@ -170,11 +171,11 @@ def set_version(asm, version, file_version, assembly_version, output_file, outpu
|
|
170
171
|
end
|
171
172
|
|
172
173
|
# checks nuget dependency
|
173
|
-
def check_package_version_dependency
|
174
|
+
def check_package_version_dependency package_uri, package, version='IsLatestVersion'
|
174
175
|
# retrieve package version info
|
175
176
|
response = Net::HTTP.get_response(URI.parse(package_uri.sub('pkg', package))) # get_response takes a URI object
|
176
177
|
package_info = response.body
|
177
|
-
xml = Nokogiri::XML
|
178
|
+
xml = Nokogiri::XML package_info
|
178
179
|
xml.xpath("//m:properties/d:#{version}").each { |e|
|
179
180
|
if e.text.to_s == 'true'
|
180
181
|
version = e.parent.xpath('d:Version').text
|
@@ -182,13 +183,13 @@ def check_package_version_dependency(package_uri, package, version='IsLatestVers
|
|
182
183
|
}
|
183
184
|
|
184
185
|
# grab all packages.config files
|
185
|
-
config_files = Dir.glob
|
186
|
+
config_files = Dir.glob '**/packages.config'
|
186
187
|
|
187
188
|
# for each file match version. Return false is check fails
|
188
189
|
config_files.each{ |file|
|
189
|
-
doc = Nokogiri::XML(File.read
|
190
|
+
doc = Nokogiri::XML(File.read file)
|
190
191
|
node = doc.at_xpath("//*[@id=\"#{package}\"]")
|
191
|
-
if
|
192
|
+
if !node.nil?
|
192
193
|
config_version = node.attr('version')
|
193
194
|
puts "Package: #{package} Latest Version: #{version} File: #{file} File package version: #{config_version}"
|
194
195
|
return false unless config_version.to_s == version
|
@@ -198,17 +199,17 @@ def check_package_version_dependency(package_uri, package, version='IsLatestVers
|
|
198
199
|
return true
|
199
200
|
end
|
200
201
|
|
201
|
-
def copy_runtime_artifacts
|
202
|
+
def copy_runtime_artifacts package
|
202
203
|
|
203
204
|
# grab all packages.config files
|
204
|
-
config_files = Dir.glob
|
205
|
+
config_files = Dir.glob '**/packages.config'
|
205
206
|
config_version = ''
|
206
207
|
|
207
208
|
# find package version
|
208
209
|
config_files.each{ |file|
|
209
|
-
doc = Nokogiri::XML(File.read
|
210
|
+
doc = Nokogiri::XML(File.read file)
|
210
211
|
node = doc.at_xpath("//*[@id=\"#{package}\"]")
|
211
|
-
if
|
212
|
+
if !node.nil?
|
212
213
|
config_version = node.attr('version').to_s
|
213
214
|
break
|
214
215
|
end
|
@@ -225,7 +226,7 @@ end
|
|
225
226
|
|
226
227
|
# Gathers all rake files and runs the task list
|
227
228
|
def package rake_files_path, task_list
|
228
|
-
if
|
229
|
+
if task_list.nil?
|
229
230
|
puts "No task to execute"
|
230
231
|
else
|
231
232
|
Dir.glob("#{rake_files_path}/*.rb").each {
|
data/test/test_azdeploy.rb
CHANGED
data/test/test_versioning.rb
CHANGED
@@ -9,7 +9,7 @@ class TestVersioning < Test::Unit::TestCase
|
|
9
9
|
def test_version_multiple_semver_no_build_counter
|
10
10
|
versioning 'TEST', 'Test.semver'
|
11
11
|
assert_equal ENV['TEST_NUGET_VERSION'] , '1.1.1-develop'
|
12
|
-
|
12
|
+
assert ENV['TEST_BUILD_VERSION'].start_with?('1.1.1-develop'), 'Matched'
|
13
13
|
assert_equal ENV['TEST_FORMAL_VERSION'], '1.1.1.0'
|
14
14
|
end
|
15
15
|
|
@@ -17,17 +17,17 @@ class TestVersioning < Test::Unit::TestCase
|
|
17
17
|
ENV['BUILD_COUNTER'] = '500'
|
18
18
|
versioning 'TEST', 'Test.semver'
|
19
19
|
assert_equal ENV['TEST_NUGET_VERSION'] , '1.1.1-develop'
|
20
|
-
|
20
|
+
assert ENV['TEST_BUILD_VERSION'] .start_with?('1.1.1-develop'), 'Matched'
|
21
21
|
assert_equal ENV['TEST_FORMAL_VERSION'], '1.1.1.500'
|
22
22
|
ENV['BUILD_COUNTER'] = nil
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_version_single_semver_no_build_counter
|
26
26
|
versioning
|
27
|
-
|
27
|
+
assert ENV['BUILD_VERSION'].start_with?('2.4.1-develop')
|
28
28
|
assert_equal ENV['NUGET_VERSION'], '2.4.1-develop'
|
29
29
|
#assert_match ENV['PLATFORM_VERSION'], Time.new.strftime('%y.%-m.%-d')
|
30
|
-
|
30
|
+
assert ENV['PLATFORM_VERSION'].start_with?('15.12.'), 'Matched'
|
31
31
|
#assert_match ENV['PLATFORM_BUILD_VERSION'], Time.new.strftime('%y.%-m.%-d')
|
32
32
|
assert_equal ENV['FORMAL_VERSION'], '2.4.1.0'
|
33
33
|
end
|
@@ -35,10 +35,10 @@ class TestVersioning < Test::Unit::TestCase
|
|
35
35
|
def test_version_single_semver_with_build_counter
|
36
36
|
ENV['BUILD_COUNTER'] = '500'
|
37
37
|
versioning
|
38
|
-
|
38
|
+
assert ENV['BUILD_VERSION'].start_with?('2.4.1-develop')
|
39
39
|
assert_equal ENV['NUGET_VERSION'], '2.4.1-develop'
|
40
40
|
#assert_match ENV['PLATFORM_VERSION'], Time.new.strftime('%y.%-m.%-d')
|
41
|
-
|
41
|
+
assert ENV['PLATFORM_VERSION'].start_with?('15.12.'), 'Matched'
|
42
42
|
#assert_match ENV['PLATFORM_BUILD_VERSION'], Time.new.strftime('%y.%-m.%-d')
|
43
43
|
assert_equal ENV['FORMAL_VERSION'], '2.4.1.500'
|
44
44
|
ENV['BUILD_COUNTER'] = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azdeploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suresh Batta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Azure Deployment Gem. Provides easy setup and deployment scripting support
|
14
14
|
for .Net project builds
|