azdeploy 1.0.31 → 1.0.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 674516fefe82d0733e648702a2ec69fa968a7b8e
4
- data.tar.gz: 30a2c43e9661a78c24ab4162ce1594ed05e50d4e
3
+ metadata.gz: 7a8147ddcc47320a4d4f85e5af9b0665805afa14
4
+ data.tar.gz: 4ddce1a21bb9acb5b17607f7f1f740a1f3cf00ae
5
5
  SHA512:
6
- metadata.gz: e78e962ec74558b18003e56e1f10db172fc88b25e06f77214126d9765c698f02e3372142285f31bbf291ae836e7b669998ef00db75529fa6f993989c0367af4e
7
- data.tar.gz: 1fc74904ea5c665d5925916554803ad89e4035685a4c486625f1081e07988d21be4a33b8296104de957f9e81589fc2210b3878037abb099bfd398193539c9a9b
6
+ metadata.gz: 2611a5fb86cdc4725627ced19aabaf091260830d575ced18bd4185c77e4e3619fd49740561e1f6006da73c793e8d7b4d624f3037b84c930870ea5c9641e97b59
7
+ data.tar.gz: ecc037759a214e79a45209fe33ef3076ce119fb2b8deb8a01b29aebf485b7bdfcbd6caca8e463c28cbc0a59fd1bed7e566725128d0b783dfe1b98b797a4200fa
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.31'
4
- s.date = '2015-12-16'
3
+ s.version = '1.0.32'
4
+ s.date = '2015-12-17'
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,28 +1,28 @@
1
1
  $versionMap = {}
2
2
 
3
3
  def copy_output_files(fromDir, filePattern, outDir)
4
- FileUtils.mkdir_p outDir unless exists?(outDir)
5
- Dir.glob(File.join(fromDir, filePattern)){|file|
6
- copy(file, outDir) if File.file?(file)
7
- }
4
+ FileUtils.mkdir_p outDir unless exists?(outDir)
5
+ Dir.glob(File.join(fromDir, filePattern)){|file|
6
+ copy(file, outDir) if File.file?(file)
7
+ }
8
8
  end
9
9
 
10
10
  def project_outputs(props)
11
- props[:projects].map{ |p| "src/#{p}/bin/#{BUILD_CONFIG}/#{p}.dll" }.
12
- concat( props[:projects].map{ |p| "src/#{p}/bin/#{BUILD_CONFIG}/#{p}.exe" } ).
13
- find_all{ |path| exists?(path) }
11
+ props[:projects].map{ |p| "src/#{p}/bin/#{BUILD_CONFIG}/#{p}.dll" }.
12
+ concat( props[:projects].map{ |p| "src/#{p}/bin/#{BUILD_CONFIG}/#{p}.exe" } ).
13
+ find_all{ |path| exists?(path) }
14
14
  end
15
15
 
16
16
  def get_commit_hash_and_date
17
- begin
18
- commit = `git log -1 --pretty=format:%H`
19
- git_date = `git log -1 --date=iso --pretty=format:%ad`
20
- commit_date = DateTime.parse( git_date ).strftime("%Y-%m-%d %H%M%S")
21
- rescue
22
- commit = "git unavailable"
23
- end
17
+ begin
18
+ commit = `git log -1 --pretty=format:%H`
19
+ git_date = `git log -1 --date=iso --pretty=format:%ad`
20
+ commit_date = DateTime.parse( git_date ).strftime("%Y-%m-%d %H%M%S")
21
+ rescue
22
+ commit = "git unavailable"
23
+ end
24
24
 
25
- [commit, commit_date]
25
+ [commit, commit_date]
26
26
  end
27
27
 
28
28
  def add_files stage, what_dlls, nuspec, folder='lib'
@@ -48,14 +48,14 @@ def commit_data
48
48
  end
49
49
 
50
50
  def waitfor(&block)
51
- checks = 0
51
+ checks = 0
52
52
 
53
- until block.call || checks >10
54
- sleep 0.5
55
- checks += 1
56
- end
53
+ until block.call || checks >10
54
+ sleep 0.5
55
+ checks += 1
56
+ end
57
57
 
58
- 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
58
+ 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
59
  end
60
60
 
61
61
  def cleantask(props)
@@ -79,8 +79,8 @@ def cleantask(props)
79
79
  end
80
80
 
81
81
  def restore_nuget(nuget_exe)
82
- sh 'powershell', '-Command', "& { Invoke-RestMethod https://www.nuget.org/nuget.exe -OutFile '#{nuget_exe}' }"
83
- sh nuget_exe, 'restore', "src/#{PRODUCT}.sln"
82
+ sh 'powershell', '-Command', "& { Invoke-RestMethod https://www.nuget.org/nuget.exe -OutFile '#{Dir.pwd}/#{nuget_exe}' }"
83
+ sh "#{Dir.pwd}/#{nuget_exe}", 'restore', "src/#{PRODUCT}.sln"
84
84
  end
85
85
 
86
86
  def restore_project_pkgs(proj)
@@ -100,49 +100,49 @@ def clean_build(msb, solution)
100
100
  end
101
101
 
102
102
  def versioning project=nil, file=nil
103
- if (!project.nil? && !file.nil?)
104
- v = SemVer.new
105
- path = File.join VERSIONING, file
106
- v.load path
107
- ver = v
108
- commitData = commit_data()
109
- # nuget (not full semver 2.0.0-rc.1 support) see http://nuget.codeplex.com/workitem/1796
110
- ENV["#{project}_NUGET_VERSION"] = ver.format('%M.%m.%p%s')
111
-
112
- revision = (ENV['BUILD_NUMBER'] || ver.patch).to_i
113
-
114
- # extensible number w/ git hash
115
- ENV["#{project}_BUILD_VERSION"] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
116
-
117
- # purely M.m.p format
118
- ENV["#{project}_FORMAL_VERSION"] = "#{ SemVer.new(ver.major, ver.minor, revision).format '%M.%m.%p'}"
119
- else
120
- ver = SemVer.find
121
- revision = (ENV['BUILD_NUMBER'] || ver.patch).to_i
122
- var = SemVer.new(ver.major, ver.minor, revision, ver.special)
123
-
124
- commitData = commit_data()
125
-
126
- # extensible number w/ git hash
127
- ENV['BUILD_VERSION'] = $versionMap[:build_version] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
128
-
129
- # nuget (not full semver 2.0.0-rc.1 support) see http://nuget.codeplex.com/workitem/1796
130
- ENV['NUGET_VERSION'] = $versionMap[:nuget_version] = ver.format('%M.%m.%p%s')
131
-
132
- ENV['PLATFORM_VERSION'] = $versionMap[:platform_version] = Time.new.strftime('%y.%-m.%-d') + ".#{(ENV['BUILD_NUMBER'] || '0')}"
133
-
134
- ENV['PLATFORM_BUILD_VERSION'] = $versionMap[:platform_build_version] = Time.new.strftime('%y.%-m.%-d') + ".#{commitData[0]}"
135
-
136
- ENV['FORMAL_VERSION'] = $versionMap[:formal_version] = "#{ SemVer.new(ver.major, ver.minor, revision).format '%M.%m.%p'}"
137
-
138
- teamcity_build_number
139
- end
103
+ if (!project.nil? && !file.nil?)
104
+ v = SemVer.new
105
+ path = File.join VERSIONING, file
106
+ v.load path
107
+ ver = v
108
+ commitData = commit_data()
109
+ # nuget (not full semver 2.0.0-rc.1 support) see http://nuget.codeplex.com/workitem/1796
110
+ ENV["#{project}_NUGET_VERSION"] = ver.format('%M.%m.%p%s')
111
+
112
+ revision = (ENV['BUILD_NUMBER'] || ver.patch).to_i
113
+
114
+ # extensible number w/ git hash
115
+ ENV["#{project}_BUILD_VERSION"] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
116
+
117
+ # purely M.m.p format
118
+ ENV["#{project}_FORMAL_VERSION"] = "#{ SemVer.new(ver.major, ver.minor, revision).format '%M.%m.%p'}"
119
+ else
120
+ ver = SemVer.find
121
+ revision = (ENV['BUILD_NUMBER'] || ver.patch).to_i
122
+ var = SemVer.new(ver.major, ver.minor, revision, ver.special)
123
+
124
+ commitData = commit_data()
125
+
126
+ # extensible number w/ git hash
127
+ ENV['BUILD_VERSION'] = $versionMap[:build_version] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
128
+
129
+ # nuget (not full semver 2.0.0-rc.1 support) see http://nuget.codeplex.com/workitem/1796
130
+ ENV['NUGET_VERSION'] = $versionMap[:nuget_version] = ver.format('%M.%m.%p%s')
131
+
132
+ ENV['PLATFORM_VERSION'] = $versionMap[:platform_version] = Time.new.strftime('%y.%-m.%-d') + ".#{(ENV['BUILD_NUMBER'] || '0')}"
133
+
134
+ ENV['PLATFORM_BUILD_VERSION'] = $versionMap[:platform_build_version] = Time.new.strftime('%y.%-m.%-d') + ".#{commitData[0]}"
135
+
136
+ ENV['FORMAL_VERSION'] = $versionMap[:formal_version] = "#{ SemVer.new(ver.major, ver.minor, revision).format '%M.%m.%p'}"
137
+
138
+ teamcity_build_number
139
+ end
140
140
  end
141
141
 
142
142
  desc 'Tell teamcity our decision to set the build.number environment variable'
143
143
  def teamcity_build_number
144
- platform_version = Time.new.strftime('%y.%-m.%-d') + ".#{(ENV['BUILD_NUMBER'] || '0')}"
145
- puts "##teamcity[buildNumber '#{platform_version}']"
144
+ platform_version = Time.new.strftime('%y.%-m.%-d') + ".#{(ENV['BUILD_NUMBER'] || '0')}"
145
+ puts "##teamcity[buildNumber '#{platform_version}']"
146
146
  end
147
147
 
148
148
  def set_framework_version(asm)
@@ -160,8 +160,8 @@ def set_version(asm, version, file_version, assembly_version, output_file, outpu
160
160
  asm.version = version
161
161
  asm.file_version = file_version
162
162
  asm.custom_attributes :AssemblyInformationalVersion => assembly_version,
163
- :ComVisibleAttribute => false,
164
- :CLSCompliantAttribute => true
163
+ :ComVisibleAttribute => false,
164
+ :CLSCompliantAttribute => true
165
165
  asm.copyright = COPYRIGHT
166
166
  asm.output_file = "#{output_file_src}/#{output_file}.Version.cs"
167
167
  asm.namespaces 'System', 'System.Reflection', 'System.Runtime.InteropServices'
@@ -212,7 +212,7 @@ def copy_runtime_artifacts(package)
212
212
  end
213
213
  }
214
214
  puts config_version
215
-
215
+
216
216
  # copy artifacts
217
217
  source = "#{ENV['RuntimePath']}/#{config_version}"
218
218
  dest = File.join(File.expand_path('.'), 'RuntimeService')
@@ -223,14 +223,14 @@ end
223
223
 
224
224
  desc 'Gathers all rake files and runs the task list'
225
225
  def package rake_files_path, task_list
226
- if(task_list.nil?)
227
- puts "No task to execute"
228
- else
229
- Dir.glob("#{rake_files_path}/*.rb").each {
230
- |r| load r
231
- }
232
- task_list.each { |eachtask|
233
- Rake::Task["#{eachtask}"].invoke
234
- }
235
- end
236
- end
226
+ if(task_list.nil?)
227
+ puts "No task to execute"
228
+ else
229
+ Dir.glob("#{rake_files_path}/*.rb").each {
230
+ |r| load r
231
+ }
232
+ task_list.each { |eachtask|
233
+ Rake::Task["#{eachtask}"].invoke
234
+ }
235
+ end
236
+ end
data/lib/dependency.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  def auto_add_dependencies(project, nuspec)
2
- @Dependencies = Array.new
3
-
4
- each_package_dependency(project) do |package|
5
- @Dependencies << package
6
- end
7
-
8
- @Dependencies.each do |dep|
9
- nuspec.dependency dep.Name, dep.Version
10
- end
2
+ @Dependencies = Array.new
3
+
4
+ each_package_dependency(project) do |package|
5
+ @Dependencies << package
6
+ end
7
+
8
+ @Dependencies.each do |dep|
9
+ nuspec.dependency dep.Name, dep.Version
10
+ end
11
11
  end
12
12
 
13
13
 
@@ -26,18 +26,18 @@ def each_package(packages_config)
26
26
  doc = REXML::Document.new xml
27
27
  doc.elements.each 'packages/package' do |package|
28
28
  if block_given?
29
- yield package.attributes['id'], package.attributes['version']
29
+ yield package.attributes['id'], package.attributes['version']
30
30
  else
31
- "no package block"
31
+ "no package block"
32
32
  end
33
33
  end
34
34
  end
35
35
 
36
36
  class Dependency
37
- attr_accessor :Name, :Version
38
-
39
- def initialize(name, version)
40
- @Name = name
41
- @Version = version
42
- end
43
- end
37
+ attr_accessor :Name, :Version
38
+
39
+ def initialize(name, version)
40
+ @Name = name
41
+ @Version = version
42
+ end
43
+ end
@@ -2,6 +2,7 @@ class SemverVersioning
2
2
 
3
3
  # url template of file to check for version info with repo, branch and file path to replace
4
4
  URLTEMPLATE ||= "%s/raw/%s/%s"
5
+ SEMVER = 'semver'
5
6
 
6
7
  def open url
7
8
  Net::HTTP.get(URI.parse url)
@@ -38,15 +39,15 @@ class SemverVersioning
38
39
  version_remote = ''
39
40
  version_local = ''
40
41
 
41
- semvers = get_file_list VERSIONING, 'semver'
42
- if(semvers.empty?)
42
+ semvers = get_file_list VERSIONING, SEMVER
43
+ if semvers.empty?
43
44
  raise "************Error - no semver files found at #{VERSIONING}********"
44
45
  end
45
46
 
46
47
  semvers.each { |semver|
47
48
  v1 = get_repo_version semver
48
49
  v2 = get_current_version VERSIONING, semver.gsub("#{VERSIONING}/", '')
49
- if (!same_versions(v1, v2))
50
+ if (!same_versions v1, v2)
50
51
  puts "#{semver} version changed"
51
52
  semver_file = semver
52
53
  version_remote = v1
@@ -119,31 +120,31 @@ class SemverVersioning
119
120
  remote_name = get_remote_name
120
121
  branch_name = get_branch_name
121
122
  url = URLTEMPLATE % [remote_name, branch_name, semver]
122
- page_content = open(url)
123
- repo_version = get_semver_version(page_content)
123
+ page_content = open url
124
+ repo_version = get_semver_version page_content
124
125
  repo_version
125
126
  end
126
127
 
127
128
  def get_current_version path, semver
128
129
  location = File.join path, semver
129
- content = File.read(location)
130
- current_version = get_semver_version(content)
130
+ content = File.read location
131
+ current_version = get_semver_version content
131
132
  current_version
132
133
  end
133
134
 
134
- def get_semver_version(content)
135
+ def get_semver_version content
135
136
  s = content.split("\n")
136
137
  val = ''
137
138
  s.each{ |i|
138
- if (i.start_with?(':'))
139
+ if i.start_with?(':')
139
140
  x = i.split(': ')[1].strip
140
- x.gsub!("'", '')
141
- if (x.length != 0)
141
+ x.gsub! "'", ''
142
+ if x.length != 0
142
143
  val = val + x.to_s + '.'
143
144
  end
144
145
  end
145
146
  }
146
- val.chomp('.')
147
+ val.chomp '.'
147
148
  end
148
149
 
149
150
  def same_versions version1, version2
@@ -153,8 +154,8 @@ class SemverVersioning
153
154
  # Method to be used from the upgrade project, to update single or multiple semvers on team city
154
155
  def auto_update_semver project_name, semver_location, semver_file, semver_dimension
155
156
  Dir.chdir project_name if File.basename(Dir.pwd) != project_name
156
- if(semver_file.nil? || semver_file.strip == '' || semver_file == '.semver')
157
- increment_version '.semver', semver_dimension
157
+ if(semver_file.nil? || semver_file.strip == '' || semver_file == '.' + SEMVER)
158
+ increment_version '.' + SEMVER, semver_dimension
158
159
  else
159
160
  increment_version File.join(semver_location, semver_file), semver_dimension
160
161
  update_dependent_semvers project_name, semver_location, semver_file, semver_dimension
@@ -163,7 +164,7 @@ class SemverVersioning
163
164
 
164
165
  # Method invoked to update multiple semvers locally. This will not update single semver. That has to be done manually
165
166
  def auto_update_local_semver
166
- if(!Dir.exist?(VERSIONING) || File.exist?('.semver'))
167
+ if(!Dir.exist?(VERSIONING) || File.exist?('.' + SEMVER))
167
168
  raise 'Error - local upgrade process only applies to projects with multiple semvers. If you have one semver at root level, please update it manually if needed. Do not invoke auto_update_local_semver task.'
168
169
  end
169
170
  updated_semver_with_version_state = fetch_updated_semver
@@ -186,10 +187,10 @@ class SemverVersioning
186
187
  def create_semver_project_map product, semver_location
187
188
  semver_project_map = Hash.new
188
189
 
189
- rake_list = get_file_list semver_location, 'semver'
190
+ rake_list = get_file_list semver_location, SEMVER
190
191
  rake_list.each{ |rakefile|
191
192
  rake = rakefile.gsub "#{semver_location}/", ''
192
- project_name = rake.gsub '.semver', ''
193
+ project_name = rake.gsub '.' + SEMVER, ''
193
194
  semver_project_map[rake] = "#{product}.#{project_name}.csproj"
194
195
  }
195
196
  semver_project_map
data/lib/transform.rb CHANGED
@@ -275,7 +275,8 @@ class Transform
275
275
 
276
276
  # log level
277
277
  node = doc.at_css 'log4net/root/level'
278
- node['value'] = ENV['loglevel'] if !node.nil?
278
+ loglevel = ENV['loglevel'] || NO_VALUE
279
+ node['value'] = ENV['loglevel'] if (!node.nil? && loglevel != NO_VALUE)
279
280
 
280
281
  File.write file, doc.to_xml
281
282
  }
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.31
4
+ version: 1.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suresh Batta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2015-12-17 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