@@ -31,7 +31,7 @@ class SpringInsight < JavaBuildpack::Component::BaseComponent
3131 # @param [Hash] context a collection of utilities used the component
3232 def initialize ( context )
3333 super ( context )
34- @version , @uri = supports? ? find_insight_agent : [ nil , nil ]
34+ @version , @uri , @agent_id , @agent_pass = supports? ? find_insight_agent : [ nil , nil , nil , nil ]
3535 end
3636
3737 # (see JavaBuildpack::Component::BaseComponent#detect)
@@ -79,8 +79,8 @@ def add_agent_configuration
7979 . add_system_property ( 'agent.http.host' , URI ( @uri ) . host )
8080 . add_system_property ( 'agent.http.port' , 80 )
8181 . add_system_property ( 'agent.http.context.path' , 'insight' )
82- . add_system_property ( 'agent.http.username' , 'spring' )
83- . add_system_property ( 'agent.http.password' , 'insight' )
82+ . add_system_property ( 'agent.http.username' , @agent_id )
83+ . add_system_property ( 'agent.http.password' , @agent_pass )
8484 . add_system_property ( 'agent.http.send.json' , false )
8585 . add_system_property ( 'agent.http.use.proxy' , false )
8686 end
@@ -111,21 +111,16 @@ def install_insight(agent_dir)
111111
112112 init_container_libs root
113113 init_insight_cloudfoundry_agent_plugin root
114- init_extra_applications root
115114 init_insight root
116- init_insight_analyzer root
115+ init_insight_agent_plugins root
117116 init_weaver root
118117 end
119118
120119 def init_container_libs ( root )
121120 move container_libs_directory ,
122121 root + 'agents/common/insight-bootstrap-generic-*.jar' ,
123- root + 'agents/tomcat/7/lib/insight-bootstrap-tomcat-common-*.jar'
124- end
125-
126- def init_extra_applications ( root )
127- move extra_applications_directory ,
128- root + 'insight-agent'
122+ root + 'agents/tomcat/7/lib/insight-bootstrap-tomcat-common-*.jar' ,
123+ root + 'agents/tomcat/7/lib/insight-agent-*.jar'
129124 end
130125
131126 def init_insight ( root )
@@ -134,8 +129,8 @@ def init_insight(root)
134129 root + 'insight/conf'
135130 end
136131
137- def init_insight_analyzer ( root )
138- move insight_analyzer_directory + 'WEB-INF/lib ' ,
132+ def init_insight_agent_plugins ( root )
133+ move insight_directory + 'agent-plugins ' ,
139134 root + 'transport/http/insight-agent-http-*.jar' ,
140135 root + 'cloudfoundry/insight-agent-cloudfoundry-*.jar'
141136 end
@@ -147,27 +142,21 @@ def init_insight_cloudfoundry_agent_plugin(root)
147142
148143 def init_weaver ( root )
149144 move weaver_directory ,
150- root + 'agents/common /insight-weaver-*.jar'
145+ root + 'cloudfoundry /insight-weaver-*.jar'
151146 end
152147
153148 def container_libs_directory
154149 @droplet . root + '.spring-insight/container-libs'
155150 end
156151
157- def extra_applications_directory
158- @droplet . root + '.spring-insight/extra-applications'
159- end
160-
161152 def find_insight_agent
162- service = @application . services . find_service FILTER
163- version = service [ 'label' ] . match ( /(.*)-(.*)/ ) [ 2 ]
164- uri = service [ 'credentials' ] [ 'dashboard_url' ]
165-
166- return version , uri # rubocop:disable RedundantReturn
167- end
168-
169- def insight_analyzer_directory
170- extra_applications_directory + 'insight-agent'
153+ service = @application . services . find_service FILTER
154+ version = service [ 'label' ] . match ( /(.*)-(.*)/ ) [ 2 ]
155+ credentials = service [ 'credentials' ]
156+ uri = credentials [ 'dashboard_url' ]
157+ id = credentials [ 'agent_username' ]
158+ pass = credentials [ 'agent_password' ]
159+ return version , uri , id , pass # rubocop:disable RedundantReturn
171160 end
172161
173162 def insight_directory
@@ -187,7 +176,7 @@ def move(destination, *globs)
187176 end
188177
189178 def supports?
190- @application . services . one_service? FILTER , 'dashboard_url'
179+ @application . services . one_service? FILTER , 'dashboard_url' , 'agent_username' , 'agent_password'
191180 end
192181
193182 def uber_agent_zip ( location )
0 commit comments