ucb_deployer 0.0.10 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake'
3
3
  require 'echoe'
4
4
  require 'spec/rake/spectask'
5
5
 
6
- Echoe.new('ucb_deployer', '0.0.10') do |p|
6
+ Echoe.new('ucb_deployer', '0.1.0') do |p|
7
7
  p.description = "Tool for deploying (Java/JRuby) war files to tomcat"
8
8
  p.url = "http://ucbrb.rubyforge.org"
9
9
  p.author = "Steven Hansen"
@@ -35,10 +35,16 @@ module UcbDeployer
35
35
 
36
36
  def deploy
37
37
  display_maintenance_file if maintenance_file_dir
38
- FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}*"])
39
- FileUtils.mkdir("#{deploy_dir}/#{war_name}")
40
- FileUtils.cp(Dir["#{build_dir}/src/dist/*.war"], "#{deploy_dir}/#{war_name}")
41
- `jar -xvf #{deploy_dir}/#{war_name}/#{war_name}.war`
38
+
39
+ if File.exists?("#{deploy_dir}/#{war_name}")
40
+ FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}"])
41
+ end
42
+
43
+ FileUtils.mkdir("#{deploy_dir}/#{war_name}")
44
+ FileUtils.mv("#{build_dir}/src/dist/confluence-#{version}.war",
45
+ "#{deploy_dir}/#{war_name}/#{war_name}.war")
46
+
47
+ `cd #{deploy_dir}/#{war_name}/ && jar -xvf #{war_name}.war`
42
48
  FileUtils.rm("#{deploy_dir}/#{war_name}/#{war_name}.war")
43
49
  end
44
50
 
@@ -142,10 +148,6 @@ module UcbDeployer
142
148
  # Remove the postgres jar since we have it installed at the container level
143
149
  FileUtils.rm_rf(Dir["#{build_dir}/src/confluence/WEB-INF/lib/postgresql-*"])
144
150
  end
145
-
146
- def debug(str)
147
- UcbDeployer.debug(str)
148
- end
149
151
  end
150
152
  end
151
153
 
@@ -58,7 +58,9 @@ module UcbDeployer
58
58
  # +data_dir+
59
59
  #
60
60
  def load_config(config_file)
61
- hash = YAML.load_file(config_file)
61
+ if !(hash = YAML.load_file(config_file))
62
+ raise(ConfigError, "Config file [#{config_file}] contains no options.")
63
+ end
62
64
 
63
65
  debug("Config options:")
64
66
  debug("")
@@ -72,6 +74,10 @@ module UcbDeployer
72
74
  end
73
75
  end
74
76
 
77
+ def debug(str)
78
+ UcbDeployer.debug(str)
79
+ end
80
+
75
81
  def display_maintenance_file()
76
82
  maint_start = Time.now.strftime("%m-%d-%Y %H:%M:%S")
77
83
  template = ERB.new(maintenance_template)
@@ -116,6 +122,6 @@ module UcbDeployer
116
122
  </html>
117
123
  }
118
124
  end
119
-
125
+
120
126
  end
121
127
  end
@@ -3,73 +3,141 @@ module UcbDeployer
3
3
  class JiraDeployer < Deployer
4
4
 
5
5
  def initialize(config_file = "#{ENV['HOME']}/config/jira/deploy.yml")
6
- FileUtils.touch(config_file) if !File.exists?(config_file)
6
+ debug("Using config file: #{config_file}")
7
+ debug("")
7
8
  load_config(config_file)
8
9
  end
9
10
 
10
11
  def export()
12
+ UcbDeployer.debug("Exporting from: #{svn_project_url}/jira-#{version}")
13
+ pwd = Dir.getwd
14
+ Dir.chdir("#{build_dir}")
15
+ FileUtils.rm_rf("#{build_dir}/src")
16
+ `svn export svn+ssh://#{svn_username}@#{svn_project_url}/jira-#{version}`
17
+ FileUtils.mv("jira-#{version}", "src")
18
+ Dir.chdir(pwd)
19
+ $stdout.puts("Export Completed")
11
20
  end
12
21
 
13
- def configure
22
+ def configure()
23
+ config_web_xml
24
+ config_seraph_config_xml
25
+ reshuffle_jars
14
26
  end
15
27
 
16
- def build
28
+ def build()
29
+ pwd = Dir.getwd
30
+ Dir.chdir("#{build_dir}/src")
31
+ `sh #{build_dir}/src/build.sh`
32
+ Dir.chdir(pwd)
17
33
  end
18
34
 
19
- def deploy
35
+ def deploy()
36
+ display_maintenance_file if maintenance_file_dir
37
+
38
+ if File.exists?("#{deploy_dir}/#{war_name}")
39
+ FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}"])
40
+ end
41
+
42
+ FileUtils.mkdir("#{deploy_dir}/#{war_name}")
43
+ FileUtils.mv("#{build_dir}/src/dist/jira-#{version}.war",
44
+ "#{deploy_dir}/#{war_name}/#{war_name}.war")
45
+
46
+ `cd #{deploy_dir}/#{war_name}/ && jar -xvf #{war_name}.war`
47
+ FileUtils.rm("#{deploy_dir}/#{war_name}/#{war_name}.war")
20
48
  end
21
49
 
22
- def rollback
50
+ def rollback()
23
51
  end
24
52
 
25
53
  ##
26
- # Shortcut to confluence web.xml file
54
+ # Shortcut to jira web.xml file
27
55
  #
28
56
  def web_xml()
57
+ "#{build_dir}/src/jira/WEB-INF/web.xml"
29
58
  end
30
59
 
31
60
  ##
32
- # Shortcut to confluence seraph-config.xml file
61
+ # Shortcut to jira seraph-config.xml file
33
62
  #
34
63
  def seraph_config_xml()
64
+ "#{build_dir}/src/jira/WEB-INF/classes/seraph-config.xml"
35
65
  end
36
66
 
37
- ##
38
- # Shortcut to confluence confluence-init.properties file
39
- #
40
- def confluence_init_properties()
67
+ def web_xml_token()
68
+ "<!-- filters -->"
41
69
  end
42
70
 
43
- def web_xml_token()
71
+ def seraph_config_xml_auth_class_token()
72
+ "com.atlassian.seraph.auth.DefaultAuthenticator"
44
73
  end
45
74
 
46
- def seraph_config_xml_token()
75
+ def seraph_config_xml_logout_url_token()
76
+ "/secure/Logout!default.jspa"
47
77
  end
48
78
 
49
79
  def cas_authenticator_class()
80
+ "org.soulwing.cas.apps.atlassian.ConfluenceCasAuthenticator"
81
+ end
82
+
83
+ def cas_logout_url()
84
+ "/casLogout.action"
50
85
  end
51
86
 
52
87
  ##
53
- # Updates the confluence web.xml file with the soulwing (CAS library)
88
+ # Updates the jira web.xml file with the soulwing (CAS library)
54
89
  # authentication configuration
55
90
  #
56
91
  def config_web_xml()
92
+ web_xml = File.readlines(self.web_xml)
93
+
94
+ web_xml = web_xml.map do |line|
95
+ if line =~ /#{web_xml_token}/
96
+ template = File.open("#{DEPLOYER_HOME}/resources/jira_cas_web.xml") { |f| f.read }
97
+ ERB.new(template).result(self.send(:binding))
98
+ else
99
+ line
100
+ end
101
+ end
102
+
103
+ File.open(self.web_xml, "w") do |io|
104
+ web_xml.each { |line| io.puts(line) }
105
+ end
57
106
  end
58
107
 
59
108
  ##
60
- # Updates the confluence seraph_config.xml file with the soulwing
109
+ # Updates the jira seraph_config.xml file with the soulwing
61
110
  # authenticator.
62
111
  #
63
112
  def config_seraph_config_xml()
113
+ seraph_xml = File.readlines(self.seraph_config_xml)
114
+
115
+ seraph_xml = seraph_xml.map do |line|
116
+ if m = /(#{Regexp.quote(seraph_config_xml_auth_class_token)})/.match(line)
117
+ debug(m[0])
118
+ new_str = "#{m.pre_match}#{cas_authenticator_class}#{m.post_match}"
119
+ debug(new_str)
120
+ new_str
121
+ elsif m = /(#{Regexp.quote(seraph_config_xml_logout_url_token)})/.match(line)
122
+ debug(m[0])
123
+ new_str = "#{m.pre_match}#{cas_logout_url}#{m.post_match}"
124
+ debug(new_str)
125
+ new_str
126
+ else
127
+ line
128
+ end
129
+ end
130
+
131
+ File.open(self.seraph_config_xml, "w") do |io|
132
+ seraph_xml.each { |line| io.puts(line) }
133
+ end
64
134
  end
65
135
 
66
- ##
67
- # Sets the confluence.home property in the file: confluence-init.properties
68
- #
69
- def config_confluence_init_properties()
70
- end
71
-
72
136
  def reshuffle_jars()
137
+ FileUtils.cp(Dir["#{UcbDeployer::RESOURCES_DIR}/lib/jotm-2.0.13/lib/*"],
138
+ "#{build_dir}/src/jira/WEB-INF/lib/")
139
+ FileUtils.cp(Dir["#{UcbDeployer::RESOURCES_DIR}/soulwing-casclient-*"],
140
+ "#{build_dir}/src/jira/WEB-INF/lib/")
73
141
  end
74
142
 
75
143
  end
@@ -98,4 +98,6 @@
98
98
  <filter-name>CAS-Service-Validation</filter-name>
99
99
  <url-pattern>/*</url-pattern>
100
100
  </filter-mapping>
101
- <!-- end CAS Configuration -->
101
+ <!-- end CAS Configuration -->
102
+
103
+
@@ -92,4 +92,7 @@
92
92
  <filter-name>CAS-Service-Validation</filter-name>
93
93
  <url-pattern>/*</url-pattern>
94
94
  </filter-mapping>
95
- <!-- end CAS Configuration -->
95
+ <!-- end CAS Configuration -->
96
+
97
+
98
+
@@ -0,0 +1,833 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
3
+ <web-app>
4
+ <!-- General -->
5
+ <display-name>Atlassian JIRA Web Application</display-name>
6
+ <description>The Atlassian JIRA web application - see http://www.atlassian.com/software/jira for more information
7
+ </description>
8
+
9
+ <!-- filters -->
10
+ <filter>
11
+ <filter-name>DatabaseCompatibilityEnforcer</filter-name>
12
+ <filter-class>com.atlassian.jira.appconsistency.db.DatabaseCompatibilityEnforcerFilter</filter-class>
13
+ </filter>
14
+
15
+
16
+ <filter>
17
+ <filter-name>headersanitising</filter-name>
18
+ <filter-class>com.atlassian.core.filters.HeaderSanitisingFilter</filter-class>
19
+ </filter>
20
+
21
+ <!--This filter is used to determine is there are any Application Errors before any pages are accessed -->
22
+ <filter>
23
+ <filter-name>consistency</filter-name>
24
+ <filter-class>com.atlassian.johnson.filters.JohnsonFilter</filter-class>
25
+ </filter>
26
+
27
+ <filter>
28
+ <filter-name>consistency503</filter-name>
29
+ <filter-class>com.atlassian.johnson.filters.Johnson503Filter</filter-class>
30
+ </filter>
31
+
32
+ <filter>
33
+ <filter-name>consistencySoap</filter-name>
34
+ <filter-class>com.atlassian.johnson.filters.JohnsonSoapFilter</filter-class>
35
+ </filter>
36
+
37
+ <filter>
38
+ <filter-name>consistencyXmlRpc</filter-name>
39
+ <filter-class>com.atlassian.johnson.filters.JohnsonXmlRpcFilter</filter-class>
40
+ </filter>
41
+
42
+ <filter>
43
+ <filter-name>UrlRewriteFilter</filter-name>
44
+ <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
45
+ </filter>
46
+
47
+ <filter>
48
+ <filter-name>profiling</filter-name>
49
+ <filter-class>com.atlassian.jira.web.filters.JIRAProfilingFilter</filter-class>
50
+ <init-param>
51
+ <!-- specify the which HTTP parameter to use to turn the filter on or off -->
52
+ <!-- if not specified - defaults to "profile.filter" -->
53
+ <param-name>activate.param</param-name>
54
+ <param-value>jira_profile</param-value>
55
+ </init-param>
56
+ <init-param>
57
+ <!-- specify the whether to start the filter automatically -->
58
+ <!-- if not specified - defaults to "true" -->
59
+ <param-name>autostart</param-name>
60
+ <param-value>false</param-value>
61
+ </init-param>
62
+ </filter>
63
+
64
+ <filter>
65
+ <filter-name>request-cleanup</filter-name>
66
+ <filter-class>com.atlassian.jira.web.filters.RequestCleanupFilter</filter-class>
67
+ </filter>
68
+
69
+ <!-- this filter sets an attribute in the request to stop JiraServletDispatcher from popping all actions off the stack.
70
+ It will clear the action stack AFTER the sitemesh decorator has rendered the page.-->
71
+ <filter>
72
+ <filter-name>action-cleanup-delay</filter-name>
73
+ <filter-class>com.atlassian.jira.web.filters.ActionCleanupDelayFilter</filter-class>
74
+ </filter>
75
+
76
+ <filter>
77
+ <filter-name>sitemesh-exclude</filter-name>
78
+ <filter-class>com.atlassian.jira.web.filters.SitemeshExcludePathFilter</filter-class>
79
+ </filter>
80
+
81
+ <filter>
82
+ <filter-name>sitemesh</filter-name>
83
+ <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
84
+ </filter>
85
+
86
+ <filter>
87
+ <filter-name>encoding</filter-name>
88
+ <filter-class>com.atlassian.jira.web.filters.JIRAEncodingFilter</filter-class>
89
+ </filter>
90
+
91
+ <filter>
92
+ <filter-name>login</filter-name>
93
+ <filter-class>com.atlassian.seraph.filter.LoginFilter</filter-class>
94
+ </filter>
95
+
96
+ <filter>
97
+ <filter-name>trustedapps</filter-name>
98
+ <filter-class>com.atlassian.jira.security.auth.trustedapps.TrustedApplicationFilter</filter-class>
99
+ </filter>
100
+
101
+ <filter>
102
+ <filter-name>security</filter-name>
103
+ <filter-class>com.atlassian.jira.security.JiraSecurityFilter</filter-class>
104
+ </filter>
105
+
106
+ <filter>
107
+ <filter-name>gzip</filter-name>
108
+ <filter-class>com.atlassian.jira.web.filters.gzip.JiraGzipFilter</filter-class>
109
+ </filter>
110
+
111
+ <filter>
112
+ <filter-name>access</filter-name>
113
+ <filter-class>com.atlassian.jira.web.filters.AccessLogFilter</filter-class>
114
+ </filter>
115
+
116
+
117
+ <!-- THIS MUST REMAIN AS THE TOP FILTER SO THAT THE ENCODING CAN BE SET BEFORE ANYTHING ELSE TOUCHES IT -->
118
+ <filter-mapping>
119
+ <filter-name>DatabaseCompatibilityEnforcer</filter-name>
120
+ <url-pattern>/*</url-pattern>
121
+ </filter-mapping>
122
+
123
+ <filter-mapping>
124
+ <filter-name>encoding</filter-name>
125
+ <url-pattern>/*</url-pattern>
126
+ </filter-mapping>
127
+
128
+ <!-- gzip *must* be before UrlRewriteFilter as the rewrite filter sends 'forwards' -->
129
+ <filter-mapping>
130
+ <filter-name>gzip</filter-name>
131
+ <url-pattern>/*</url-pattern>
132
+ </filter-mapping>
133
+
134
+ <filter-mapping>
135
+ <filter-name>UrlRewriteFilter</filter-name>
136
+ <url-pattern>/*</url-pattern>
137
+ </filter-mapping>
138
+
139
+ <!-- These mapping are for URL's that can handle an HTML error message when JIRA is unavailable -->
140
+ <filter-mapping>
141
+ <filter-name>consistency</filter-name>
142
+ <url-pattern>*.jsp</url-pattern>
143
+ </filter-mapping>
144
+ <filter-mapping>
145
+ <filter-name>consistency</filter-name>
146
+ <url-pattern>*.jspa</url-pattern>
147
+ </filter-mapping>
148
+ <filter-mapping>
149
+ <filter-name>consistency</filter-name>
150
+ <url-pattern>/browse/*</url-pattern>
151
+ </filter-mapping>
152
+ <filter-mapping>
153
+ <filter-name>consistency</filter-name>
154
+ <url-pattern>/logout</url-pattern>
155
+ </filter-mapping>
156
+ <filter-mapping>
157
+ <filter-name>consistency</filter-name>
158
+ <url-pattern>*.vm</url-pattern>
159
+ </filter-mapping>
160
+ <filter-mapping>
161
+ <filter-name>consistency</filter-name>
162
+ <url-pattern>/lazyLoader</url-pattern>
163
+ </filter-mapping>
164
+
165
+ <!--
166
+ These mapping are for URL's that can NOT handle an HTML error message when JIRA is unavailable, these will
167
+ get a 503 Service Unavailable response instead.
168
+ -->
169
+ <filter-mapping>
170
+ <filter-name>consistency503</filter-name>
171
+ <url-pattern>/sr/*</url-pattern>
172
+ </filter-mapping>
173
+ <filter-mapping>
174
+ <filter-name>consistency503</filter-name>
175
+ <url-pattern>/si/*</url-pattern>
176
+ </filter-mapping>
177
+ <filter-mapping>
178
+ <filter-name>consistency503</filter-name>
179
+ <url-pattern>/download/*</url-pattern>
180
+ </filter-mapping>
181
+ <filter-mapping>
182
+ <filter-name>consistency503</filter-name>
183
+ <url-pattern>/includes/js/combined-javascript.js</url-pattern>
184
+ </filter-mapping>
185
+ <filter-mapping>
186
+ <filter-name>consistency503</filter-name>
187
+ <url-pattern>/plugins/servlet/*</url-pattern>
188
+ </filter-mapping>
189
+ <filter-mapping>
190
+ <filter-name>consistency503</filter-name>
191
+ <url-pattern>/secure/attachment/*</url-pattern>
192
+ </filter-mapping>
193
+ <filter-mapping>
194
+ <filter-name>consistency503</filter-name>
195
+ <url-pattern>/rpc/trackback/*</url-pattern>
196
+ </filter-mapping>
197
+ <filter-mapping>
198
+ <filter-name>consistency503</filter-name>
199
+ <url-pattern>/dwr/*</url-pattern>
200
+ </filter-mapping>
201
+
202
+ <!--
203
+ This mapping is for the Soap endpoint URL's that can NOT handle an HTML error message when JIRA is unavailable,
204
+ these will get a proper SoapFault packet instead.
205
+ -->
206
+ <filter-mapping>
207
+ <filter-name>consistencySoap</filter-name>
208
+ <url-pattern>/rpc/soap/*</url-pattern>
209
+ </filter-mapping>
210
+
211
+ <!--
212
+ This mapping is for the XML-RPC endpoint URL's that can NOT handle an HTML error message when JIRA is unavailable,
213
+ these will get a proper XML-RPC Fault packet instead.
214
+ -->
215
+ <filter-mapping>
216
+ <filter-name>consistencyXmlRpc</filter-name>
217
+ <url-pattern>/rpc/xmlrpc</url-pattern>
218
+ </filter-mapping>
219
+
220
+
221
+ <filter-mapping>
222
+ <filter-name>request-cleanup</filter-name>
223
+ <url-pattern>/*</url-pattern>
224
+ </filter-mapping>
225
+
226
+ <filter-mapping>
227
+ <filter-name>action-cleanup-delay</filter-name>
228
+ <url-pattern>/*</url-pattern>
229
+ </filter-mapping>
230
+
231
+ <filter-mapping>
232
+ <filter-name>profiling</filter-name>
233
+ <url-pattern>*.jsp</url-pattern>
234
+ </filter-mapping>
235
+
236
+ <filter-mapping>
237
+ <filter-name>profiling</filter-name>
238
+ <url-pattern>*.jspa</url-pattern>
239
+ </filter-mapping>
240
+
241
+ <filter-mapping>
242
+ <filter-name>profiling</filter-name>
243
+ <url-pattern>/browse/*</url-pattern>
244
+ </filter-mapping>
245
+
246
+ <filter-mapping>
247
+ <filter-name>profiling</filter-name>
248
+ <url-pattern>/rpc/*</url-pattern>
249
+ </filter-mapping>
250
+
251
+ <!-- profiling filter should be mapped to search request &amp; single issue -->
252
+ <filter-mapping>
253
+ <filter-name>profiling</filter-name>
254
+ <url-pattern>/si/*</url-pattern>
255
+ </filter-mapping>
256
+
257
+ <filter-mapping>
258
+ <filter-name>profiling</filter-name>
259
+ <url-pattern>/sr/*</url-pattern>
260
+ </filter-mapping>
261
+
262
+ <filter-mapping>
263
+ <filter-name>profiling</filter-name>
264
+ <url-pattern>/plugins/servlet/*</url-pattern>
265
+ </filter-mapping>
266
+
267
+ <filter-mapping>
268
+ <filter-name>profiling</filter-name>
269
+ <url-pattern>/lazyLoader</url-pattern>
270
+ </filter-mapping>
271
+
272
+ <filter-mapping>
273
+ <filter-name>login</filter-name>
274
+ <url-pattern>/*</url-pattern>
275
+ </filter-mapping>
276
+
277
+ <filter-mapping>
278
+ <filter-name>trustedapps</filter-name>
279
+ <url-pattern>/*</url-pattern>
280
+ </filter-mapping>
281
+
282
+ <filter-mapping>
283
+ <filter-name>security</filter-name>
284
+ <url-pattern>/*</url-pattern>
285
+ </filter-mapping>
286
+
287
+ <filter-mapping>
288
+ <filter-name>sitemesh</filter-name>
289
+ <url-pattern>*.jsp</url-pattern>
290
+ </filter-mapping>
291
+
292
+ <filter-mapping>
293
+ <filter-name>sitemesh</filter-name>
294
+ <url-pattern>/logout.jsp</url-pattern>
295
+ </filter-mapping>
296
+
297
+ <filter-mapping>
298
+ <filter-name>sitemesh</filter-name>
299
+ <url-pattern>/login.jsp</url-pattern>
300
+ </filter-mapping>
301
+
302
+ <filter-mapping>
303
+ <filter-name>sitemesh-exclude</filter-name>
304
+ <url-pattern>/secure/*</url-pattern>
305
+ </filter-mapping>
306
+
307
+ <filter-mapping>
308
+ <filter-name>sitemesh</filter-name>
309
+ <url-pattern>/view/*</url-pattern>
310
+ </filter-mapping>
311
+
312
+ <filter-mapping>
313
+ <filter-name>sitemesh</filter-name>
314
+ <url-pattern>/browse/*</url-pattern>
315
+ </filter-mapping>
316
+
317
+ <filter-mapping>
318
+ <filter-name>access</filter-name>
319
+ <url-pattern>/*</url-pattern>
320
+ </filter-mapping>
321
+
322
+ <filter-mapping>
323
+ <filter-name>headersanitising</filter-name>
324
+ <url-pattern>/*</url-pattern>
325
+ </filter-mapping>
326
+
327
+ <!-- listeners -->
328
+ <!--
329
+ This order is important for shutdown and startup, ie the ConsistencyLauncher will call "SHUTDOWN"
330
+ on a HSQL DB database, and so must be called 'after' the com.atlassian.jira.scheduler.JiraSchedulerLauncher
331
+ -->
332
+
333
+ <listener>
334
+ <listener-class>com.atlassian.jira.web.ServletContextProviderListener</listener-class>
335
+ </listener>
336
+
337
+ <!--
338
+ This listener checks for database compatibility and creates a Johnson event
339
+ in the case when the database should not be used.
340
+ -->
341
+ <listener>
342
+ <listener-class>com.atlassian.jira.appconsistency.db.DatabaseCompatibilityEnforcer</listener-class>
343
+ </listener>
344
+
345
+ <!-- Check consistency of database etc -->
346
+ <listener>
347
+ <listener-class>com.atlassian.jira.upgrade.ConsistencyLauncher</listener-class>
348
+ </listener>
349
+
350
+ <!-- Check for upgrades, and automatically perform them if neccessary. -->
351
+ <listener>
352
+ <listener-class>com.atlassian.jira.upgrade.UpgradeLauncher</listener-class>
353
+ </listener>
354
+
355
+ <!-- Launch the scheduler, which loads all the jobs from scheduler-config.xml -->
356
+ <listener>
357
+ <listener-class>com.atlassian.jira.scheduler.JiraSchedulerLauncher</listener-class>
358
+ </listener>
359
+
360
+ <!-- XML-RPC / SOAP Listener -->
361
+ <listener>
362
+ <listener-class>com.atlassian.jira.soap.axis.JiraAxisHttpListener</listener-class>
363
+ </listener>
364
+
365
+
366
+ <!-- servlets -->
367
+ <servlet>
368
+ <servlet-name>action</servlet-name>
369
+ <servlet-class>com.atlassian.jira.web.dispatcher.JiraServletDispatcher</servlet-class>
370
+ <load-on-startup>1</load-on-startup>
371
+ </servlet>
372
+
373
+ <servlet>
374
+ <servlet-name>viewattachment</servlet-name>
375
+ <servlet-class>com.atlassian.jira.web.servlet.ViewAttachmentServlet</servlet-class>
376
+ </servlet>
377
+
378
+ <servlet>
379
+ <servlet-name>viewthumbnail</servlet-name>
380
+ <servlet-class>com.atlassian.jira.web.servlet.ViewThumbnailServlet</servlet-class>
381
+ </servlet>
382
+
383
+ <servlet>
384
+ <servlet-name>quicklink</servlet-name>
385
+ <servlet-class>com.atlassian.jira.servlet.QuickLinkServlet</servlet-class>
386
+ </servlet>
387
+
388
+ <!-- Used for tricking WebSphere 6.1.0.5 to push requests through the filter chain. This servlet
389
+ should never receive the actual requests as the requests should be intercepted, by e.g. URLRewrite filter.
390
+ Fixes JRA-12039 -->
391
+ <servlet>
392
+ <servlet-name>noopservlet</servlet-name>
393
+ <servlet-class>com.atlassian.jira.servlet.NoOpServlet</servlet-class>
394
+ </servlet>
395
+
396
+ <servlet>
397
+ <servlet-name>trackback</servlet-name>
398
+ <servlet-class>com.atlassian.trackback.TrackbackListenerServlet</servlet-class>
399
+ <init-param>
400
+ <param-name>trackbackStore</param-name>
401
+ <param-value>com.atlassian.jira.trackback.OfbizTrackbackStore</param-value>
402
+ </init-param>
403
+ </servlet>
404
+
405
+ <servlet>
406
+ <servlet-name>xmlrpc</servlet-name>
407
+ <servlet-class>com.atlassian.jira.web.servlet.rpc.XmlRpcServlet</servlet-class>
408
+ </servlet>
409
+
410
+ <servlet>
411
+ <servlet-name>pluginvelocityservlet</servlet-name>
412
+ <servlet-class>com.atlassian.jira.plugin.webwork.JiraPluginWebworkVelocityServlet</servlet-class>
413
+ </servlet>
414
+
415
+ <servlet>
416
+ <servlet-name>servlet-module-container-servlet</servlet-name>
417
+ <servlet-class>com.atlassian.jira.plugin.servlet.ServletModuleContainerServlet</servlet-class>
418
+ </servlet>
419
+
420
+ <!--
421
+ <servlet>
422
+ <servlet-name>ChartServlet</servlet-name>
423
+ <servlet-class>com.atlassian.jira.chart.ChartServlet</servlet-class>
424
+ </servlet>
425
+ -->
426
+
427
+ <servlet>
428
+ <servlet-name>logout</servlet-name>
429
+ <servlet-class>com.atlassian.seraph.logout.LogoutServlet</servlet-class>
430
+ </servlet>
431
+
432
+ <!-- Axis SOAP Servlet -->
433
+ <servlet>
434
+ <servlet-name>axis-soap</servlet-name>
435
+ <servlet-class>com.atlassian.jira.web.servlet.rpc.LazyAxisDecoratorServlet</servlet-class>
436
+ <init-param>
437
+ <param-name>httpRegistryRoot</param-name>
438
+ <param-value>/</param-value>
439
+ </init-param>
440
+ </servlet>
441
+
442
+ <servlet>
443
+ <servlet-name>javascript</servlet-name>
444
+ <display-name>Combined Javascript Servlet</display-name>
445
+ <servlet-class>com.atlassian.cache.servlet.CombinedCachingServlet</servlet-class>
446
+ <init-param>
447
+ <param-name>content.type</param-name>
448
+ <param-value>text/javascript</param-value>
449
+ </init-param>
450
+ <init-param>
451
+ <param-name>content.resolver.resource</param-name>
452
+ <param-value>com.atlassian.cache.servlet.resolver.ResourceStreamResolver</param-value>
453
+ </init-param>
454
+ <init-param>
455
+ <param-name>resource1</param-name>
456
+ <param-value>/includes/js/x-jira-min.js</param-value>
457
+ </init-param>
458
+ <init-param>
459
+ <param-name>resource2</param-name>
460
+ <param-value>/includes/js/jira-global-min.js</param-value>
461
+ </init-param>
462
+ <init-param>
463
+ <param-name>resource3</param-name>
464
+ <param-value>/includes/js/quicksearch-min.js</param-value>
465
+ </init-param>
466
+ <init-param>
467
+ <param-name>content.resolver.plugins</param-name>
468
+ <param-value>com.atlassian.jira.servlet.PluginJavascriptContentResolver</param-value>
469
+ </init-param>
470
+ <init-param>
471
+ <param-name>plugins1</param-name>
472
+ <param-value>includes/js/global.js</param-value>
473
+ </init-param>
474
+ </servlet>
475
+
476
+ <!-- IE6 expects CSS files to end with .css (JRA-3747) -->
477
+ <servlet>
478
+ <servlet-name>global.css</servlet-name>
479
+ <jsp-file>/styles/global_css.jsp</jsp-file>
480
+ <init-param>
481
+ <param-name>fork</param-name>
482
+ <param-value>false</param-value>
483
+ </init-param>
484
+ </servlet>
485
+
486
+ <servlet>
487
+ <servlet-name>calendar.css</servlet-name>
488
+ <jsp-file>/includes/js/calendar/skins/aqua/theme.jsp</jsp-file>
489
+ <init-param>
490
+ <param-name>fork</param-name>
491
+ <param-value>false</param-value>
492
+ </init-param>
493
+ </servlet>
494
+
495
+ <servlet>
496
+ <servlet-name>css</servlet-name>
497
+ <display-name>Combined CSS Servlet</display-name>
498
+ <servlet-class>com.atlassian.cache.servlet.CombinedCachingServlet</servlet-class>
499
+ <init-param>
500
+ <param-name>content.type</param-name>
501
+ <param-value>text/css</param-value>
502
+ </init-param>
503
+ <init-param>
504
+ <param-name>content.resolver.dynamicCss</param-name>
505
+ <param-value>com.atlassian.jira.servlet.DynamicCSSContentResolver</param-value>
506
+ </init-param>
507
+ <init-param>
508
+ <param-name>dynamicCss</param-name>
509
+ <param-value>/global.css</param-value>
510
+ </init-param>
511
+ <init-param>
512
+ <param-name>content.resolver.resource</param-name>
513
+ <param-value>com.atlassian.cache.servlet.resolver.ResourceStreamResolver</param-value>
514
+ </init-param>
515
+ <init-param>
516
+ <param-name>resource1</param-name>
517
+ <param-value>/styles/global-static-min.css</param-value>
518
+ </init-param>
519
+ </servlet>
520
+
521
+ <servlet>
522
+ <servlet-name>printable-css</servlet-name>
523
+ <display-name>Combined Printable CSS Servlet</display-name>
524
+ <servlet-class>com.atlassian.cache.servlet.CombinedCachingServlet</servlet-class>
525
+ <init-param>
526
+ <param-name>content.type</param-name>
527
+ <param-value>text/css</param-value>
528
+ </init-param>
529
+ <init-param>
530
+ <param-name>content.resolver.dynamicCss</param-name>
531
+ <param-value>com.atlassian.jira.servlet.PrintableDynamicCSSContentResolver</param-value>
532
+ </init-param>
533
+ <init-param>
534
+ <param-name>dynamicCss</param-name>
535
+ <param-value>/printable.css</param-value>
536
+ </init-param>
537
+ </servlet>
538
+
539
+ <servlet>
540
+ <servlet-name>DisplayChart</servlet-name>
541
+ <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
542
+ <load-on-startup>1</load-on-startup>
543
+ </servlet>
544
+
545
+ <servlet>
546
+ <servlet-name>dwr-invoker</servlet-name>
547
+ <display-name>DWR Servlet</display-name>
548
+ <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
549
+ <init-param>
550
+ <param-name>debug</param-name>
551
+ <param-value>false</param-value>
552
+ </init-param>
553
+ <init-param>
554
+ <param-name>maxCallCount</param-name>
555
+ <param-value>1</param-value>
556
+ </init-param>
557
+ <init-param>
558
+ <param-name>allowGetForSafariButMakeForgeryEasier</param-name>
559
+ <param-value>true</param-value>
560
+ </init-param>
561
+ <!--
562
+ We need these parameters with DWR 2.0.x because it introduced a new
563
+ dynamically generated script/session concept that causes the
564
+ engine.js to be never cached on the client. But we don't want this
565
+ behaviour.
566
+ -->
567
+ <init-param>
568
+ <param-name>crossDomainSessionSecurity</param-name>
569
+ <param-value>false</param-value>
570
+ </init-param>
571
+ <init-param>
572
+ <param-name>url:/engine.js</param-name>
573
+ <param-value>com.atlassian.jira.web.util.dwr.JiraDWREngineHandler</param-value>
574
+ </init-param>
575
+ <init-param>
576
+ <param-name>engineHandlerUrl</param-name>
577
+ <param-value>/engine.js</param-value>
578
+ </init-param>
579
+ </servlet>
580
+
581
+ <servlet>
582
+ <servlet-name>file-server</servlet-name>
583
+ <servlet-class>com.atlassian.jira.web.servlet.FileServerServlet</servlet-class>
584
+ <load-on-startup>4</load-on-startup>
585
+ </servlet>
586
+
587
+ <servlet>
588
+ <servlet-name>issue-view</servlet-name>
589
+ <servlet-class>com.atlassian.jira.web.servlet.IssueViewServlet</servlet-class>
590
+ <load-on-startup>4</load-on-startup>
591
+ </servlet>
592
+
593
+ <servlet>
594
+ <servlet-name>searchrequest-view</servlet-name>
595
+ <servlet-class>com.atlassian.jira.web.servlet.SearchRequestViewServlet</servlet-class>
596
+ <load-on-startup>4</load-on-startup>
597
+ </servlet>
598
+
599
+ <!-- Servlet for displaying lazily loaded portlets -->
600
+ <servlet>
601
+ <servlet-name>lazy-portlet-loader</servlet-name>
602
+ <servlet-class>com.atlassian.jira.web.servlet.LazyLoadingPortletServlet</servlet-class>
603
+ </servlet>
604
+
605
+ <!-- Sitemesh velocity decorator -->
606
+ <servlet>
607
+ <servlet-name>velocity-decorator</servlet-name>
608
+ <servlet-class>com.atlassian.jira.web.servlet.VelocityDecoratorServlet</servlet-class>
609
+ </servlet>
610
+
611
+ <!-- JCAPTCHA -->
612
+ <servlet>
613
+ <servlet-name>captcha</servlet-name>
614
+ <servlet-class>com.atlassian.jira.servlet.CaptchaServlet</servlet-class>
615
+ <load-on-startup>0</load-on-startup>
616
+ </servlet>
617
+
618
+ <servlet-mapping>
619
+ <servlet-name>captcha</servlet-name>
620
+ <url-pattern>/captcha</url-pattern>
621
+ </servlet-mapping>
622
+
623
+ <!-- end:JCAPTCHA -->
624
+
625
+ <servlet-mapping>
626
+ <servlet-name>file-server</servlet-name>
627
+ <url-pattern>/download/*</url-pattern>
628
+ </servlet-mapping>
629
+
630
+ <servlet-mapping>
631
+ <servlet-name>calendar.css</servlet-name>
632
+ <url-pattern>/styles/calendar.css</url-pattern>
633
+ </servlet-mapping>
634
+
635
+ <servlet-mapping>
636
+ <servlet-name>global.css</servlet-name>
637
+ <url-pattern>/styles/global.css</url-pattern>
638
+ </servlet-mapping>
639
+
640
+ <servlet-mapping>
641
+ <servlet-name>javascript</servlet-name>
642
+ <url-pattern>/includes/js/combined-javascript.js</url-pattern>
643
+ </servlet-mapping>
644
+
645
+ <servlet-mapping>
646
+ <servlet-name>css</servlet-name>
647
+ <url-pattern>/styles/combined.css</url-pattern>
648
+ </servlet-mapping>
649
+
650
+ <servlet-mapping>
651
+ <servlet-name>printable-css</servlet-name>
652
+ <url-pattern>/styles/combined-printable.css</url-pattern>
653
+ </servlet-mapping>
654
+
655
+ <servlet-mapping>
656
+ <servlet-name>servlet-module-container-servlet</servlet-name>
657
+ <url-pattern>/plugins/servlet/*</url-pattern>
658
+ </servlet-mapping>
659
+
660
+ <!--
661
+ <servlet-mapping>
662
+ <servlet-name>ChartServlet</servlet-name>
663
+ <url-pattern>/servlet/chart/*</url-pattern>
664
+ </servlet-mapping>
665
+ -->
666
+
667
+ <servlet-mapping>
668
+ <servlet-name>axis-soap</servlet-name>
669
+ <url-pattern>/rpc/soap/*</url-pattern>
670
+ </servlet-mapping>
671
+
672
+ <servlet-mapping>
673
+ <servlet-name>action</servlet-name>
674
+ <url-pattern>*.jspa</url-pattern>
675
+ </servlet-mapping>
676
+
677
+ <!-- These are dummy servlet mappings to trick WebSphere 6.1.0.5 to push the request through the filter chain, such
678
+ that the URLRewrite filter can rewrite the URLs. Fixes JRA-12039 -->
679
+ <servlet-mapping>
680
+ <servlet-name>noopservlet</servlet-name>
681
+ <url-pattern>/s/*</url-pattern>
682
+ </servlet-mapping>
683
+
684
+ <servlet-mapping>
685
+ <servlet-name>noopservlet</servlet-name>
686
+ <url-pattern>/databaseLockedError</url-pattern>
687
+ </servlet-mapping>
688
+
689
+ <servlet-mapping>
690
+ <servlet-name>viewattachment</servlet-name>
691
+ <url-pattern>/secure/attachment/*</url-pattern>
692
+ </servlet-mapping>
693
+
694
+ <servlet-mapping>
695
+ <servlet-name>viewthumbnail</servlet-name>
696
+ <url-pattern>/secure/thumbnail/*</url-pattern>
697
+ </servlet-mapping>
698
+
699
+ <servlet-mapping>
700
+ <servlet-name>quicklink</servlet-name>
701
+ <url-pattern>/browse/*</url-pattern>
702
+ </servlet-mapping>
703
+
704
+ <servlet-mapping>
705
+ <servlet-name>trackback</servlet-name>
706
+ <url-pattern>/rpc/trackback/*</url-pattern>
707
+ </servlet-mapping>
708
+
709
+ <servlet-mapping>
710
+ <servlet-name>xmlrpc</servlet-name>
711
+ <url-pattern>/rpc/xmlrpc</url-pattern>
712
+ </servlet-mapping>
713
+
714
+ <servlet-mapping>
715
+ <servlet-name>logout</servlet-name>
716
+ <url-pattern>/logout</url-pattern>
717
+ </servlet-mapping>
718
+
719
+ <servlet-mapping>
720
+ <servlet-name>pluginvelocityservlet</servlet-name>
721
+ <url-pattern>*.vm</url-pattern>
722
+ </servlet-mapping>
723
+
724
+ <servlet-mapping>
725
+ <servlet-name>DisplayChart</servlet-name>
726
+ <url-pattern>/charts</url-pattern>
727
+ </servlet-mapping>
728
+
729
+ <servlet-mapping>
730
+ <servlet-name>dwr-invoker</servlet-name>
731
+ <url-pattern>/dwr/*</url-pattern>
732
+ </servlet-mapping>
733
+
734
+ <servlet-mapping>
735
+ <servlet-name>issue-view</servlet-name>
736
+ <url-pattern>/si/*</url-pattern>
737
+ </servlet-mapping>
738
+
739
+ <servlet-mapping>
740
+ <servlet-name>searchrequest-view</servlet-name>
741
+ <url-pattern>/sr/*</url-pattern>
742
+ </servlet-mapping>
743
+
744
+ <servlet-mapping>
745
+ <servlet-name>lazy-portlet-loader</servlet-name>
746
+ <url-pattern>/lazyLoader</url-pattern>
747
+ </servlet-mapping>
748
+
749
+ <servlet-mapping>
750
+ <servlet-name>velocity-decorator</servlet-name>
751
+ <url-pattern>*.vmd</url-pattern>
752
+ </servlet-mapping>
753
+
754
+ <!-- session config -->
755
+ <session-config>
756
+ <session-timeout>60</session-timeout>
757
+ </session-config>
758
+
759
+ <!-- mime mapping -->
760
+ <!-- currently the W3C havent settled on a media type for WSDL;
761
+ http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
762
+ for now we go with the basic 'it's XML' response -->
763
+ <mime-mapping>
764
+ <extension>wsdl</extension>
765
+ <mime-type>text/xml</mime-type>
766
+ </mime-mapping>
767
+
768
+ <mime-mapping>
769
+ <extension>xsd</extension>
770
+ <mime-type>text/xml</mime-type>
771
+ </mime-mapping>
772
+
773
+ <!-- welcome files -->
774
+ <welcome-file-list>
775
+ <welcome-file>default.jsp</welcome-file>
776
+ <welcome-file>index.html</welcome-file>
777
+ </welcome-file-list>
778
+
779
+ <!-- error pages -->
780
+ <!-- commented out error pages for development
781
+ <error-page>
782
+ <error-code>404</error-code>
783
+ <location>/404page.jsp</location>
784
+ </error-page>-->
785
+ <error-page>
786
+ <error-code>500</error-code>
787
+ <location>/500page.jsp</location>
788
+ </error-page>
789
+
790
+ <!-- tag libraries -->
791
+ <taglib>
792
+ <taglib-uri>webwork</taglib-uri>
793
+ <taglib-location>/WEB-INF/tld/webwork.tld</taglib-location>
794
+ </taglib>
795
+ <taglib>
796
+ <taglib-uri>sitemesh-page</taglib-uri>
797
+ <taglib-location>/WEB-INF/tld/sitemesh-page.tld</taglib-location>
798
+ </taglib>
799
+ <taglib>
800
+ <taglib-uri>sitemesh-decorator</taglib-uri>
801
+ <taglib-location>/WEB-INF/tld/sitemesh-decorator.tld</taglib-location>
802
+ </taglib>
803
+ <taglib>
804
+ <taglib-uri>jiratags</taglib-uri>
805
+ <taglib-location>/WEB-INF/tld/atlassian-jira-tags.tld</taglib-location>
806
+ </taglib>
807
+
808
+ <!-- resource environment references -->
809
+
810
+ <!-- resource references -->
811
+ <!-- Uncomment for WebSphere
812
+ <resource-ref>
813
+ <description>Database for JIRA</description>
814
+ <res-ref-name>jdbc/JiraDS</res-ref-name>
815
+ <res-type>javax.sql.DataSource</res-type>
816
+ <res-auth>SERVLET</res-auth>
817
+ <res-sharing-scope>Unshareable</res-sharing-scope>
818
+ </resource-ref>
819
+ Uncomment for WebSphere -->
820
+
821
+
822
+ <!-- security contraints -->
823
+
824
+ <!-- login config -->
825
+
826
+ <!-- security roles -->
827
+
828
+ <!-- environment entries -->
829
+
830
+ <!-- ejb references -->
831
+
832
+ <!-- ejb local references -->
833
+ </web-app>
data/spec/spec_helper.rb CHANGED
@@ -8,12 +8,14 @@ require 'ucb_deployer'
8
8
 
9
9
 
10
10
  TEST_BUILD_DIR = File.expand_path(File.dirname(__FILE__) + "/build") unless defined?(TEST_BUILD_DIR)
11
-
11
+
12
+
12
13
  Spec::Runner.configure do |config|
13
14
  config.before(:all) do
14
15
  dir = TEST_BUILD_DIR
15
16
  pwd = File.expand_path(File.dirname(__FILE__))
16
17
 
18
+ # setup confluence build dir
17
19
  FileUtils.mkdir_p("#{dir}/confluence/src/confluence/WEB-INF/classes")
18
20
  FileUtils.mkdir_p("#{dir}/confluence/src/confluence/WEB-INF/lib")
19
21
 
@@ -23,6 +25,15 @@ Spec::Runner.configure do |config|
23
25
  "#{dir}/confluence/src/confluence/WEB-INF/classes")
24
26
  FileUtils.cp("#{pwd}/fixtures/confluence/confluence-init.properties",
25
27
  "#{dir}/confluence/src/confluence/WEB-INF/classes")
28
+
29
+ # setup jira build dir
30
+ FileUtils.mkdir_p("#{dir}/jira/src/jira/WEB-INF/classes")
31
+ FileUtils.mkdir_p("#{dir}/jira/src/jira/WEB-INF/lib")
32
+
33
+ FileUtils.cp("#{pwd}/fixtures/jira/web.xml",
34
+ "#{dir}/jira/src/jira/WEB-INF")
35
+ FileUtils.cp("#{pwd}/fixtures/jira/seraph-config.xml",
36
+ "#{dir}/jira/src/jira/WEB-INF/classes")
26
37
  end
27
38
 
28
39
  config.after(:all) do
@@ -87,7 +87,7 @@ describe UcbDeployer::ConfluenceDeployer do
87
87
  describe "#build" do
88
88
  it "should work" do
89
89
  @cdep.build_dir = test_build_dir
90
- @cdep.should_receive(:exec).with("sh #{@cdep.build_dir}/src/build.sh")
90
+ @cdep.should_receive("`").with("sh #{@cdep.build_dir}/src/build.sh")
91
91
  @cdep.build
92
92
  end
93
93
  end
@@ -0,0 +1,95 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe UcbDeployer::JiraDeployer do
4
+
5
+ before(:each) do
6
+ @deploy_file = File.expand_path(File.dirname(__FILE__) + '/../fixtures/jira/deploy.yml')
7
+ @bad_deploy_file = File.expand_path(File.dirname(__FILE__) + '/../fixtures/jira/bad_deploy.yml')
8
+ @cdep = UcbDeployer::JiraDeployer.new(@deploy_file)
9
+ end
10
+
11
+ def test_build_dir
12
+ "#{TEST_BUILD_DIR}/jira"
13
+ end
14
+
15
+ describe "#load_config" do
16
+ it "should load configuration options" do
17
+ @cdep.build_dir.should == "/path/to/build_dir/jira"
18
+ @cdep.deploy_dir.should == "/path/to/deploy_dir"
19
+ @cdep.war_name.should == "war_name"
20
+ @cdep.svn_project_url.should == "svn.berkeley.edu/svn/ist-svn/berkeley/projects/ist/as/webapps/jira_archives/tags"
21
+ end
22
+
23
+ it "should raise error for invalid config options" do
24
+ lambda { @cdep.load_config(@bad_deploy_file) }.should raise_error(UcbDeployer::ConfigError)
25
+ end
26
+ end
27
+
28
+ describe "#config_web_xml" do
29
+ it "should configure souldwing (CAS auth) in web.xml" do
30
+ @cdep.build_dir = test_build_dir
31
+ # just checking if spec_helper did the right
32
+ File.exists?(@cdep.web_xml).should be_true
33
+
34
+ @cdep.config_web_xml
35
+ File.exists?(@cdep.web_xml).should be_true
36
+ lines = File.readlines(@cdep.web_xml)
37
+ lines.any? { |l| l =~ /<\?xml version="1\.0"\?>/ }.should be_true
38
+ lines.any? { |l| l =~ /<web-app>/ }.should be_true
39
+ lines.any? { |l| l =~ /#{@cdep.cas_server_url}/ }.should be_true
40
+ lines.any? { |l| l =~ /#{@cdep.cas_service_url}/ }.should be_true
41
+ lines.any? { |l| l =~ /<\/web-app>/ }.should be_true
42
+ end
43
+ end
44
+
45
+
46
+ describe "#config_seraph_config_xml" do
47
+ it "should configure the soulwing (CAS) authenticator in seraph_config.xml" do
48
+ @cdep.build_dir = test_build_dir
49
+ # just checking if spec_helper did the right
50
+ File.exists?(@cdep.seraph_config_xml).should be_true
51
+
52
+ @cdep.config_seraph_config_xml
53
+ File.exists?(@cdep.seraph_config_xml).should be_true
54
+ lines = File.readlines(@cdep.seraph_config_xml)
55
+ lines.any? { |l| l =~ /<security-config>/ }.should be_true
56
+ lines.any? { |l| l =~ /#{Regexp.quote(@cdep.cas_authenticator_class)}/ }.should be_true
57
+ lines.any? { |l| l =~ /#{Regexp.quote(@cdep.cas_logout_url)}/ }.should be_true
58
+ lines.any? { |l| l =~ /<\/security-config>/ }.should be_true
59
+ end
60
+ end
61
+
62
+
63
+ describe "#reshuffle_jars" do
64
+ it "should work" do
65
+ @cdep.build_dir = test_build_dir
66
+ @cdep.reshuffle_jars
67
+ Dir["#{@cdep.build_dir}/src/jira/WEB-INF/lib/soulwing-casclient-*"].should_not be_empty
68
+ Dir["#{@cdep.build_dir}/src/jira/WEB-INF/lib/jotm*"].should_not be_empty
69
+ Dir["#{@cdep.build_dir}/src/jira/WEB-INF/lib/carol*"].should_not be_empty
70
+ end
71
+ end
72
+
73
+
74
+ describe "#build" do
75
+ it "should work" do
76
+ @cdep.build_dir = test_build_dir
77
+ @cdep.should_receive("`").with("sh #{@cdep.build_dir}/src/build.sh")
78
+ @cdep.build
79
+ end
80
+ end
81
+
82
+
83
+ describe "#export" do
84
+ it "should work" do
85
+ cdep = UcbDeployer::JiraDeployer.new(@deploy_file)
86
+ cdep.build_dir = test_build_dir
87
+ cdep.version = "3.2.1_01"
88
+ arg = "svn export svn+ssh://#{cdep.svn_username}@#{cdep.svn_project_url}/jira-#{cdep.version}"
89
+ cdep.should_receive("`").with(arg).and_return(nil)
90
+ FileUtils.should_receive("mv")
91
+ cdep.export()
92
+ end
93
+ end
94
+
95
+ end
data/ucb_deployer.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ucb_deployer}
5
- s.version = "0.0.10"
5
+ s.version = "0.1.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steven Hansen"]
9
- s.date = %q{2010-10-22}
9
+ s.date = %q{2010-10-25}
10
10
  s.default_executable = %q{ucb_deploy}
11
11
  s.description = %q{Tool for deploying (Java/JRuby) war files to tomcat}
12
12
  s.email = %q{runner@berkeley.edu}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_deployer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 10
10
- version: 0.0.10
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steven Hansen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-22 00:00:00 -07:00
18
+ date: 2010-10-25 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21