azdeploy 1.0.42 → 1.0.43
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 +2 -2
- data/lib/transform.rb +30 -9
- 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: 5c5df9b70e8bbd5c168e05e4be4b3350302031e8
|
4
|
+
data.tar.gz: 3f4a0043197af334a58b0b24498497c88f908394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9f4bbeb6bd6ca2c94d2aebbd0d1c31052d321cd50e87d49e50aab5e9ab52967f89839dde800f5e81eb178bca3462361c175c88676f180cf1b9b3c711e685293
|
7
|
+
data.tar.gz: 9cdb412337e9591ec34ae0b53b5c75bb5b5f80594fa6a43aefaca9670929de1815d2e7bd3a15b6e29c46f13f7b35e6827093bdcadf8104bdf7f7cfd59fb02921
|
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 = '2016-01-
|
3
|
+
s.version = '1.0.43'
|
4
|
+
s.date = '2016-01-20'
|
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/transform.rb
CHANGED
@@ -63,13 +63,25 @@ class Transform
|
|
63
63
|
|
64
64
|
def transform_appsettings key = EMPTY_STR, value = EMPTY_STR
|
65
65
|
# go to each file and replace value of matching appSettings key
|
66
|
-
|
66
|
+
puts 'Transforming app settings.'
|
67
|
+
transform_xmlsettings(@config_files, @settings, method(:update_appsetting), key, value)
|
68
|
+
end
|
69
|
+
|
70
|
+
def transform_appdynamics_config
|
71
|
+
# update application name in the config.xml
|
72
|
+
puts 'Transforming appdynamics config.'
|
73
|
+
files = Dir.glob '**/RuntimeService/AppDynamics/config.xml'
|
74
|
+
transform_xmlsettings(files, nil, method(:update_appdynamics_application), 'name', @service_name)
|
75
|
+
end
|
76
|
+
|
77
|
+
def transform_xmlsettings files, settings, update_setting, key = EMPTY_STR, value = EMPTY_STR
|
78
|
+
files.each{|file|
|
67
79
|
doc = Nokogiri::XML(File.read file)
|
68
80
|
puts "Processing file: #{file}"
|
69
81
|
if (key.to_s != EMPTY_STR && value.to_s != EMPTY_STR)
|
70
82
|
k = key
|
71
83
|
v = value
|
72
|
-
status =
|
84
|
+
status = update_setting.call(k, v, doc, file)
|
73
85
|
if status == :updated
|
74
86
|
if @debug_mode
|
75
87
|
puts "Updated key #{k} with #{v}"
|
@@ -78,11 +90,11 @@ class Transform
|
|
78
90
|
end
|
79
91
|
end
|
80
92
|
else
|
81
|
-
if
|
82
|
-
|
93
|
+
if !settings.nil?
|
94
|
+
settings.each { |i|
|
83
95
|
k = i.properties[ROWKEY] || NO_VALUE
|
84
96
|
v = i.properties[SETTING] || NO_VALUE
|
85
|
-
status =
|
97
|
+
status = update_setting.call(k, v, doc, file)
|
86
98
|
if status == :updated
|
87
99
|
if @debug_mode
|
88
100
|
puts "Updated key #{k} with #{v}"
|
@@ -97,12 +109,20 @@ class Transform
|
|
97
109
|
end
|
98
110
|
|
99
111
|
def update_appsetting k, v, doc, file
|
112
|
+
update_xmlsetting(k, v, doc, file, "appSettings/add[@key='#{k}']")
|
113
|
+
end
|
114
|
+
|
115
|
+
def update_appdynamics_application k, v, doc, file
|
116
|
+
update_xmlsetting(k, v, doc, file, "controller/application", k)
|
117
|
+
end
|
118
|
+
|
119
|
+
def update_xmlsetting k, v, doc, file, xpath, value_key = VALUE
|
100
120
|
status = :noargs
|
101
121
|
if (k != NO_VALUE && v != NO_VALUE)
|
102
|
-
node = doc.at_css
|
122
|
+
node = doc.at_css xpath
|
103
123
|
if !node.nil?
|
104
|
-
puts "Old value: #{node[
|
105
|
-
node[
|
124
|
+
puts "Old value: #{node[value_key]}" if @debug_mode
|
125
|
+
node[value_key] = v
|
106
126
|
puts "New value: #{v}" if @debug_mode
|
107
127
|
File.write file, doc.to_xml
|
108
128
|
status = :updated
|
@@ -269,7 +289,7 @@ class Transform
|
|
269
289
|
def transform_appdynamics_node doc, xml_node
|
270
290
|
task_node = Nokogiri::XML::Node.new 'Task', doc
|
271
291
|
|
272
|
-
task_node['commandLine'] = "AppDynamics\\startup_env.cmd
|
292
|
+
task_node['commandLine'] = "AppDynamics\\startup_env.cmd"
|
273
293
|
task_node['executionContext'] = 'elevated'
|
274
294
|
task_node['taskType'] = 'simple'
|
275
295
|
|
@@ -530,6 +550,7 @@ class Transform
|
|
530
550
|
if use_appdynamics == "true"
|
531
551
|
puts 'Using app dynamics...'
|
532
552
|
xml_node_processing = method(:transform_appdynamics)
|
553
|
+
transform_appdynamics_config
|
533
554
|
end
|
534
555
|
|
535
556
|
if !((use_riverbed == "true" and use_newrelic != "true" and use_appdynamics != "true") or
|
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.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suresh Batta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-20 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
|