azdeploy 1.0.26 → 1.0.27
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 +4 -4
- data/azdeploy.gemspec +1 -1
- data/lib/transform.rb +27 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 859355fe780d4165303731253688604839dec974
|
4
|
+
data.tar.gz: d31a57cdc98296f560b9590081c02f06a4484fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b51ae0226a48d3625b7127adda10279e36fa053cba18d3896f037e699fc64b996301a5e5c3fe3d55fcec65434d35d42712fa1da20ca148e8c96b54d6fcef9823
|
7
|
+
data.tar.gz: 926e921ef0012b7462c9403a0b7f5ef1c3a8d3a7cb8058c091d783cb3d919a4c2cd52e03a431307170a646865673cf2a4c677cd1e210a774799a58c98f7eb448
|
data/azdeploy.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'azdeploy'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.27'
|
4
4
|
s.date = '2015-08-07'
|
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'
|
data/lib/transform.rb
CHANGED
@@ -10,7 +10,8 @@ class Transform
|
|
10
10
|
ROWKEY = 'RowKey'
|
11
11
|
SETTING = 'setting'
|
12
12
|
VALUE = 'value'
|
13
|
-
|
13
|
+
APPCLIENTID = 'AppClientId'
|
14
|
+
OLDAPPID = 'AppId'
|
14
15
|
EMPTY_STR = ''
|
15
16
|
STORAGEACCOUNT = 'StorageAccount'
|
16
17
|
STORAGEACCOUNTKEY = "#{STORAGEACCOUNT}Key"
|
@@ -64,13 +65,19 @@ class Transform
|
|
64
65
|
if (key.to_s != EMPTY_STR && value.to_s != EMPTY_STR)
|
65
66
|
k = key
|
66
67
|
v = value
|
67
|
-
update_appsetting(k, v, doc, file)
|
68
|
+
status = update_appsetting(k, v, doc, file)
|
69
|
+
if status == :updated
|
70
|
+
puts "Updated key #{k} with #{v}"
|
71
|
+
end
|
68
72
|
else
|
69
73
|
if (!@settings.nil?)
|
70
74
|
@settings.each { |i|
|
71
75
|
k = i.properties[ROWKEY] || NO_VALUE
|
72
76
|
v = i.properties[SETTING] || NO_VALUE
|
73
|
-
|
77
|
+
status = update_appsetting(k, v, doc, file)
|
78
|
+
if status == :updated
|
79
|
+
puts "Updated key #{k} with #{v}"
|
80
|
+
end
|
74
81
|
}
|
75
82
|
end
|
76
83
|
end
|
@@ -78,6 +85,7 @@ class Transform
|
|
78
85
|
end
|
79
86
|
|
80
87
|
def update_appsetting(k, v, doc, file)
|
88
|
+
status = :noargs
|
81
89
|
if (k != NO_VALUE && v != NO_VALUE)
|
82
90
|
node = doc.at_css "appSettings/add[@key='#{k}']"
|
83
91
|
if !node.nil?
|
@@ -85,8 +93,13 @@ class Transform
|
|
85
93
|
node[VALUE] = v
|
86
94
|
#puts "New value: #{v}"
|
87
95
|
File.write(file, doc.to_xml)
|
96
|
+
status = :updated
|
97
|
+
else
|
98
|
+
status = :notfound
|
88
99
|
end
|
89
100
|
end
|
101
|
+
|
102
|
+
status
|
90
103
|
end
|
91
104
|
|
92
105
|
def transform_servicemodelconfig
|
@@ -293,12 +306,18 @@ class Transform
|
|
293
306
|
transform_appsettings("unitest#{CONNECTIONSTRING}", unitest_connstr)
|
294
307
|
end
|
295
308
|
|
296
|
-
puts "updating #{
|
297
|
-
|
298
|
-
if
|
299
|
-
puts "No #{
|
309
|
+
puts "updating #{APPCLIENTID}..."
|
310
|
+
appClientId = ENV[APPCLIENTID] || NO_VALUE
|
311
|
+
if appClientId == NO_VALUE
|
312
|
+
puts "No #{APPCLIENTID} found."
|
313
|
+
# old version notify check
|
314
|
+
oldAppId = ENV[OLDAPPID]
|
315
|
+
if oldAppId != NO_VALUE
|
316
|
+
puts "You appear to be using the old AppId environment variable, AppClientId is expected. Proceeding with old AppId update."
|
317
|
+
transform_appsettings(OLDAPPID, oldAppId)
|
318
|
+
end
|
300
319
|
else
|
301
|
-
transform_appsettings(
|
320
|
+
transform_appsettings(APPCLIENTID, appClientId)
|
302
321
|
end
|
303
322
|
|
304
323
|
@service_name = ENV['ServiceName']
|