azdeploy 1.0.33 → 1.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ecdae0f8ea2256d9052a728e23a1be7485d1630
4
- data.tar.gz: 21a71377457ac6a58a4cdb75d4fc12ffbc127add
3
+ metadata.gz: 1beff9f62ec0352e00e8bc9f0ad80643a4185a1a
4
+ data.tar.gz: a4f306fe91651c07c602b04f54a32bf06bd0a888
5
5
  SHA512:
6
- metadata.gz: f49f2270b4705d7f0e6283b1741f0b31fbb08cf7b85ad54cd494216c151e220125d81858157c387559511213f2f13c88c71ae8eed06939039376184cf1b27c68
7
- data.tar.gz: 943d2e7bd697a4e59c17ff6c75feb2d762d8f1ee9760d853cc0fb47a3f7fa7f700299568e6add869d1c9864e815c6ac456f84cda048c9e1a6116140c746b830b
6
+ metadata.gz: ab63394183836b8b8b33f13153e28653b10fb8837f5fa7e86532a4c169540eb46018f15f213edbe2e2fee0aa7342d80597b7193a6a8d0b3c9a589c2910777520
7
+ data.tar.gz: 0549199f30a9f99a9f76a738cdd4e4937a1ba70f3a8d81acdb19b13e7e0857748c8dacf7574aea788f2092538fa4f5a95500c8d214039a2cc93a2e395f387026
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'azdeploy'
3
- s.version = '1.0.33'
4
- s.date = '2015-12-21'
3
+ s.version = '1.0.34'
4
+ s.date = '2015-12-23'
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']
@@ -22,3 +22,4 @@ include FileTest
22
22
  require 'albacore'
23
23
  require 'semver'
24
24
  require 'net/http'
25
+ require 'rake'
@@ -109,19 +109,19 @@ def versioning project=nil, file=nil
109
109
  # nuget (not full semver 2.0.0-rc.1 support) see http://nuget.codeplex.com/workitem/1796
110
110
  ENV["#{project}_NUGET_VERSION"] = ver.format('%M.%m.%p%s')
111
111
 
112
- revision = (ENV['BUILD_COUNTER'] || ver.patch).to_i
113
-
114
112
  # extensible number w/ git hash
115
- ENV["#{project}_BUILD_VERSION"] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
113
+ ENV["#{project}_BUILD_VERSION"] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
116
114
 
117
115
  # purely M.m.p format
118
- ENV["#{project}_FORMAL_VERSION"] = "#{ SemVer.new(ver.major, ver.minor, revision).format '%M.%m.%p'}"
116
+ sem = SemVer.new(ver.major, ver.minor, ver.patch).format '%M.%m.%p'
117
+ build_counter = (ENV['BUILD_COUNTER'] || '0').to_i
118
+ ENV["#{project}_FORMAL_VERSION"] = "#{sem}.#{build_counter}"
119
119
  else
120
120
  ver = SemVer.find
121
- revision = (ENV['BUILD_COUNTER'] || ver.patch).to_i
122
- var = SemVer.new(ver.major, ver.minor, revision, ver.special)
123
121
 
124
122
  commitData = commit_data()
123
+
124
+ build_counter = (ENV['BUILD_COUNTER'] || '0').to_i
125
125
 
126
126
  # extensible number w/ git hash
127
127
  ENV['BUILD_VERSION'] = $versionMap[:build_version] = ver.format('%M.%m.%p%s') + ".#{commitData[0]}"
@@ -129,11 +129,13 @@ def versioning project=nil, file=nil
129
129
  # nuget (not full semver 2.0.0-rc.1 support) see http://nuget.codeplex.com/workitem/1796
130
130
  ENV['NUGET_VERSION'] = $versionMap[:nuget_version] = ver.format('%M.%m.%p%s')
131
131
 
132
- ENV['PLATFORM_VERSION'] = $versionMap[:platform_version] = Time.new.strftime('%y.%-m.%-d') + ".#{(ENV['BUILD_NUMBER'] || '0')}"
132
+ ENV['PLATFORM_VERSION'] = $versionMap[:platform_version] = Time.new.strftime('%y.%-m.%-d') + ".#{build_counter}"
133
133
 
134
134
  ENV['PLATFORM_BUILD_VERSION'] = $versionMap[:platform_build_version] = Time.new.strftime('%y.%-m.%-d') + ".#{commitData[0]}"
135
135
 
136
- ENV['FORMAL_VERSION'] = $versionMap[:formal_version] = "#{ SemVer.new(ver.major, ver.minor, revision).format '%M.%m.%p'}"
136
+ sem = SemVer.new(ver.major, ver.minor, ver.patch).format '%M.%m.%p'
137
+
138
+ ENV['FORMAL_VERSION'] = $versionMap[:formal_version] = "#{sem}.#{build_counter}"
137
139
 
138
140
  teamcity_build_number
139
141
  end
@@ -0,0 +1,6 @@
1
+ ---
2
+ :major: 1
3
+ :minor: 1
4
+ :patch: 1
5
+ :special: develop
6
+ :metadata: ''
@@ -0,0 +1,47 @@
1
+ require_relative '../lib/build'
2
+ require 'semver'
3
+ require 'test/unit'
4
+
5
+ VERSIONING = 'test'
6
+
7
+ class TestVersioning < Test::Unit::TestCase
8
+
9
+ def test_version_multiple_semver_no_build_counter
10
+ versioning 'TEST', 'Test.semver'
11
+ assert_equal ENV['TEST_NUGET_VERSION'] , '1.1.1-develop'
12
+ assert_equal ENV['TEST_BUILD_VERSION'] , '1.1.1-develop.c84767'
13
+ assert_equal ENV['TEST_FORMAL_VERSION'], '1.1.1.0'
14
+ end
15
+
16
+ def test_version_multiple_semver_with_build_counter
17
+ ENV['BUILD_COUNTER'] = '500'
18
+ versioning 'TEST', 'Test.semver'
19
+ assert_equal ENV['TEST_NUGET_VERSION'] , '1.1.1-develop'
20
+ assert_equal ENV['TEST_BUILD_VERSION'] , '1.1.1-develop.c84767'
21
+ assert_equal ENV['TEST_FORMAL_VERSION'], '1.1.1.500'
22
+ ENV['BUILD_COUNTER'] = nil
23
+ end
24
+
25
+ def test_version_single_semver_no_build_counter
26
+ versioning
27
+ assert_equal ENV['BUILD_VERSION'], '2.4.1-develop.c84767'
28
+ assert_equal ENV['NUGET_VERSION'], '2.4.1-develop'
29
+ #assert_match ENV['PLATFORM_VERSION'], Time.new.strftime('%y.%-m.%-d')
30
+ assert_equal ENV['PLATFORM_VERSION'], '15.12.23.0'
31
+ #assert_match ENV['PLATFORM_BUILD_VERSION'], Time.new.strftime('%y.%-m.%-d')
32
+ assert_equal ENV['FORMAL_VERSION'], '2.4.1.0'
33
+ end
34
+
35
+ def test_version_single_semver_with_build_counter
36
+ ENV['BUILD_COUNTER'] = '500'
37
+ versioning
38
+ assert_equal ENV['BUILD_VERSION'], '2.4.1-develop.c84767'
39
+ assert_equal ENV['NUGET_VERSION'], '2.4.1-develop'
40
+ #assert_match ENV['PLATFORM_VERSION'], Time.new.strftime('%y.%-m.%-d')
41
+ assert_match ENV['PLATFORM_VERSION'], '15.12.23.500'
42
+ #assert_match ENV['PLATFORM_BUILD_VERSION'], Time.new.strftime('%y.%-m.%-d')
43
+ assert_equal ENV['FORMAL_VERSION'], '2.4.1.500'
44
+ ENV['BUILD_COUNTER'] = nil
45
+ end
46
+
47
+ end
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.33
4
+ version: 1.0.34
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-21 00:00:00.000000000 Z
11
+ date: 2015-12-23 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
@@ -17,7 +17,9 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - test/Test.semver
20
21
  - test/test_azdeploy.rb
22
+ - test/test_versioning.rb
21
23
  - lib/azdeploy.rb
22
24
  - lib/build.rb
23
25
  - lib/dependency.rb