ucb_deployer 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +3 -1
- data/Rakefile +1 -1
- data/TODO.md +3 -0
- data/lib/ucb_deployer/confluence_deployer.rb +19 -1
- data/lib/ucb_deployer/jira_deployer.rb +71 -57
- data/resources/ist_banner.jpg +0 -0
- data/resources/jira_cas_web.xml +1 -1
- data/resources/soulwing-casclient-0.5.3-1.jar +0 -0
- data/resources/xwork.xml +3158 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/ucb_deployer/confluence_deployer_spec.rb +13 -0
- data/spec/ucb_deployer/jira_deployer_spec.rb +9 -1
- data/ucb_deployer.gemspec +3 -3
- metadata +8 -6
- data/resources/soulwing-casclient-0.5.3.jar +0 -0
data/Manifest
CHANGED
@@ -8,8 +8,10 @@ lib/ucb_deployer/confluence_deployer.rb
|
|
8
8
|
lib/ucb_deployer/deployer.rb
|
9
9
|
lib/ucb_deployer/jira_deployer.rb
|
10
10
|
resources/confluence_cas_web.xml
|
11
|
+
resources/ist_banner.jpg
|
11
12
|
resources/jira_cas_web.xml
|
12
|
-
resources/soulwing-casclient-0.5.3.jar
|
13
|
+
resources/soulwing-casclient-0.5.3-1.jar
|
14
|
+
resources/xwork.xml
|
13
15
|
spec/fixtures/confluence/bad_deploy.yml
|
14
16
|
spec/fixtures/confluence/confluence-init.properties
|
15
17
|
spec/fixtures/confluence/deploy.yml
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require 'echoe'
|
|
4
4
|
require 'spec/rake/spectask'
|
5
5
|
|
6
6
|
|
7
|
-
Echoe.new('ucb_deployer', '0.
|
7
|
+
Echoe.new('ucb_deployer', '0.3.0') do |p|
|
8
8
|
p.description = "Tool for deploying Confluence/JIRA war files to tomcat"
|
9
9
|
p.url = "http://ucbrb.rubyforge.org"
|
10
10
|
p.author = "Steven Hansen"
|
data/TODO.md
CHANGED
@@ -4,4 +4,7 @@
|
|
4
4
|
version has already been pulled down to the filesystem, reuse it.
|
5
5
|
* For commands like display_maintenance_file and remove_maintenance_file, you should
|
6
6
|
not need to pass int the VERSION option
|
7
|
+
* Currently we're bundling our own copy of xwork.xml for Confluence, modifiying it and
|
8
|
+
then deploying. A better long term strategy would be to unjar WEB-INF/lib/confluence-3.4.2.jar
|
9
|
+
during the deployment process and modify its xwork.xml, then rejar it.
|
7
10
|
|
@@ -23,6 +23,7 @@ module UcbDeployer
|
|
23
23
|
config_web_xml()
|
24
24
|
config_seraph_config_xml()
|
25
25
|
config_confluence_init_properties()
|
26
|
+
config_xwork_xml()
|
26
27
|
reshuffle_jars()
|
27
28
|
end
|
28
29
|
|
@@ -143,7 +144,24 @@ module UcbDeployer
|
|
143
144
|
end
|
144
145
|
|
145
146
|
##
|
146
|
-
#
|
147
|
+
# Shortcut to xwork.xml file
|
148
|
+
#
|
149
|
+
def xwork_xml()
|
150
|
+
"#{build_dir}/src/confluence/WEB-INF/classes/xwork.xml"
|
151
|
+
end
|
152
|
+
|
153
|
+
##
|
154
|
+
# Alter xwork.xml so soulwing authenticator works with CAS
|
155
|
+
#
|
156
|
+
def config_xwork_xml()
|
157
|
+
template = File.open("#{UcbDeployer::RESOURCES_DIR}/xwork.xml") { |f| f.read }
|
158
|
+
xml = ERB.new(template).result(self.send(:binding))
|
159
|
+
FileUtils.touch(xwork_xml())
|
160
|
+
File.open(xwork_xml(), "w") { |io| io.puts(xml) }
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Remove application jars that have been installed at the container level.
|
147
165
|
#
|
148
166
|
def reshuffle_jars()
|
149
167
|
FileUtils.cp(Dir["#{UcbDeployer::RESOURCES_DIR}/soulwing-casclient-*"],
|
@@ -24,6 +24,7 @@ module UcbDeployer
|
|
24
24
|
config_seraph_config_xml()
|
25
25
|
config_entityengine_xml()
|
26
26
|
config_jira_application_properties()
|
27
|
+
config_ist_banner()
|
27
28
|
reshuffle_jars()
|
28
29
|
end
|
29
30
|
|
@@ -50,6 +51,11 @@ module UcbDeployer
|
|
50
51
|
def rollback()
|
51
52
|
end
|
52
53
|
|
54
|
+
def cas_logout_url()
|
55
|
+
"/casLogout.action"
|
56
|
+
end
|
57
|
+
|
58
|
+
|
53
59
|
##
|
54
60
|
# Shortcut to jira web.xml file
|
55
61
|
#
|
@@ -57,33 +63,36 @@ module UcbDeployer
|
|
57
63
|
"#{build_dir}/src/webapp/WEB-INF/web.xml"
|
58
64
|
end
|
59
65
|
|
60
|
-
|
61
|
-
|
62
|
-
#
|
63
|
-
def entityengine_xml()
|
64
|
-
"#{build_dir}/src/edit-webapp/WEB-INF/classes/entityengine.xml"
|
66
|
+
def web_xml_token()
|
67
|
+
"appropriate error message for any requests. Basically it locks JIRA. -->"
|
65
68
|
end
|
66
69
|
|
67
70
|
##
|
68
|
-
#
|
71
|
+
# Updates the jira web.xml file with the soulwing (CAS library)
|
72
|
+
# authentication configuration
|
69
73
|
#
|
70
|
-
def
|
71
|
-
|
74
|
+
def config_web_xml()
|
75
|
+
web_xml = File.readlines(self.web_xml)
|
76
|
+
|
77
|
+
web_xml = web_xml.map do |line|
|
78
|
+
if line =~ /#{web_xml_token}/
|
79
|
+
template = File.open("#{DEPLOYER_HOME}/resources/jira_cas_web.xml") { |f| f.read }
|
80
|
+
line + ERB.new(template).result(self.send(:binding))
|
81
|
+
else
|
82
|
+
line
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
File.open(self.web_xml, "w") do |io|
|
87
|
+
web_xml.each { |line| io.puts(line) }
|
88
|
+
end
|
72
89
|
end
|
73
90
|
|
74
91
|
##
|
75
|
-
# Shortcut to jira
|
92
|
+
# Shortcut to jira entityengine.xml file
|
76
93
|
#
|
77
|
-
def
|
78
|
-
"#{build_dir}/src/edit-webapp/WEB-INF/classes/
|
79
|
-
end
|
80
|
-
|
81
|
-
def web_xml_token()
|
82
|
-
"appropriate error message for any requests. Basically it locks JIRA. -->"
|
83
|
-
end
|
84
|
-
|
85
|
-
def seraph_config_xml_auth_class_token()
|
86
|
-
"com.atlassian.jira.security.login.JiraOsUserAuthenticator"
|
94
|
+
def entityengine_xml()
|
95
|
+
"#{build_dir}/src/edit-webapp/WEB-INF/classes/entityengine.xml"
|
87
96
|
end
|
88
97
|
|
89
98
|
def entityengine_xml_db_token()
|
@@ -94,22 +103,6 @@ module UcbDeployer
|
|
94
103
|
"schema-name=\"PUBLIC\""
|
95
104
|
end
|
96
105
|
|
97
|
-
def jira_home_token()
|
98
|
-
"jira.home ="
|
99
|
-
end
|
100
|
-
|
101
|
-
def seraph_config_xml_logout_url_token()
|
102
|
-
"/secure/Logout!default.jspa"
|
103
|
-
end
|
104
|
-
|
105
|
-
def cas_authenticator_class()
|
106
|
-
"org.soulwing.cas.apps.atlassian.JiraCasAuthenticator"
|
107
|
-
end
|
108
|
-
|
109
|
-
def cas_logout_url()
|
110
|
-
"/casLogout.action"
|
111
|
-
end
|
112
|
-
|
113
106
|
def entityengine_db()
|
114
107
|
"field-type-name=\"postgres72\""
|
115
108
|
end
|
@@ -118,27 +111,6 @@ module UcbDeployer
|
|
118
111
|
"schema-name=\"jira_app\""
|
119
112
|
end
|
120
113
|
|
121
|
-
##
|
122
|
-
# Updates the jira web.xml file with the soulwing (CAS library)
|
123
|
-
# authentication configuration
|
124
|
-
#
|
125
|
-
def config_web_xml()
|
126
|
-
web_xml = File.readlines(self.web_xml)
|
127
|
-
|
128
|
-
web_xml = web_xml.map do |line|
|
129
|
-
if line =~ /#{web_xml_token}/
|
130
|
-
template = File.open("#{DEPLOYER_HOME}/resources/jira_cas_web.xml") { |f| f.read }
|
131
|
-
line + ERB.new(template).result(self.send(:binding))
|
132
|
-
else
|
133
|
-
line
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
File.open(self.web_xml, "w") do |io|
|
138
|
-
web_xml.each { |line| io.puts(line) }
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
114
|
##
|
143
115
|
# Updates the jira entityengine.xml file with the correct database configs
|
144
116
|
#
|
@@ -166,6 +138,25 @@ module UcbDeployer
|
|
166
138
|
end
|
167
139
|
end
|
168
140
|
|
141
|
+
##
|
142
|
+
# Shortcut to jira seraph-config.xml file
|
143
|
+
#
|
144
|
+
def seraph_config_xml()
|
145
|
+
"#{build_dir}/src/webapp/WEB-INF/classes/seraph-config.xml"
|
146
|
+
end
|
147
|
+
|
148
|
+
def seraph_config_xml_auth_class_token()
|
149
|
+
"com.atlassian.jira.security.login.JiraOsUserAuthenticator"
|
150
|
+
end
|
151
|
+
|
152
|
+
def seraph_config_xml_logout_url_token()
|
153
|
+
"/secure/Logout!default.jspa"
|
154
|
+
end
|
155
|
+
|
156
|
+
def cas_authenticator_class()
|
157
|
+
"org.soulwing.cas.apps.atlassian.JiraCasAuthenticator"
|
158
|
+
end
|
159
|
+
|
169
160
|
##
|
170
161
|
# Updates the jira seraph_config.xml file with the soulwing
|
171
162
|
# authenticator.
|
@@ -181,7 +172,7 @@ module UcbDeployer
|
|
181
172
|
new_str
|
182
173
|
elsif m = /(#{Regexp.quote(seraph_config_xml_logout_url_token)})/.match(line)
|
183
174
|
debug(m[0])
|
184
|
-
new_str = "#{m.pre_match}#{
|
175
|
+
new_str = "#{m.pre_match}#{cas_server_url}/logout#{m.post_match}"
|
185
176
|
debug(new_str)
|
186
177
|
new_str
|
187
178
|
else
|
@@ -194,6 +185,17 @@ module UcbDeployer
|
|
194
185
|
end
|
195
186
|
end
|
196
187
|
|
188
|
+
##
|
189
|
+
# Shortcut to jira-application.properties file
|
190
|
+
#
|
191
|
+
def jira_application_properties()
|
192
|
+
"#{build_dir}/src/edit-webapp/WEB-INF/classes/jira-application.properties"
|
193
|
+
end
|
194
|
+
|
195
|
+
def jira_home_token()
|
196
|
+
"jira.home ="
|
197
|
+
end
|
198
|
+
|
197
199
|
##
|
198
200
|
# Sets the jira.home property in the file: jira-application.properties.
|
199
201
|
#
|
@@ -213,7 +215,19 @@ module UcbDeployer
|
|
213
215
|
jira_props.each { |line| io.puts(line) }
|
214
216
|
end
|
215
217
|
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Places IST banner jpg in imaages directory
|
221
|
+
#
|
222
|
+
def config_ist_banner()
|
223
|
+
FileUtils.cp("#{UcbDeployer::RESOURCES_DIR}/ist_banner.jpg",
|
224
|
+
"#{build_dir}/src/webapp/images/")
|
225
|
+
end
|
216
226
|
|
227
|
+
##
|
228
|
+
# Remove jars from WEB-INF/lib that have been installed at the container
|
229
|
+
# level to avoid conflicts.
|
230
|
+
#
|
217
231
|
def reshuffle_jars()
|
218
232
|
FileUtils.mkdir_p("#{build_dir}/src/edit-webapp/WEB-INF/lib/")
|
219
233
|
FileUtils.cp(Dir["#{UcbDeployer::RESOURCES_DIR}/soulwing-casclient-*"],
|
Binary file
|
data/resources/jira_cas_web.xml
CHANGED
Binary file
|