ucb_deployer 0.1.0 → 0.1.1

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.
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.1.0') do |p|
6
+ Echoe.new('ucb_deployer', '0.1.1') 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"
@@ -22,6 +22,7 @@ module UcbDeployer
22
22
  def configure()
23
23
  config_web_xml
24
24
  config_seraph_config_xml
25
+ config_entityengine_xml
25
26
  reshuffle_jars
26
27
  end
27
28
 
@@ -40,7 +41,7 @@ module UcbDeployer
40
41
  end
41
42
 
42
43
  FileUtils.mkdir("#{deploy_dir}/#{war_name}")
43
- FileUtils.mv("#{build_dir}/src/dist/jira-#{version}.war",
44
+ FileUtils.mv("#{build_dir}/src/dist-tomcat/atlassian-jira-#{version}.war",
44
45
  "#{deploy_dir}/#{war_name}/#{war_name}.war")
45
46
 
46
47
  `cd #{deploy_dir}/#{war_name}/ && jar -xvf #{war_name}.war`
@@ -54,14 +55,21 @@ module UcbDeployer
54
55
  # Shortcut to jira web.xml file
55
56
  #
56
57
  def web_xml()
57
- "#{build_dir}/src/jira/WEB-INF/web.xml"
58
+ "#{build_dir}/src/webapp/WEB-INF/web.xml"
59
+ end
60
+
61
+ ##
62
+ # Shortcut to jira entityengine.xml file
63
+ #
64
+ def entityengine_xml()
65
+ "#{build_dir}/src/edit-webapp/WEB-INF/classes/entityengine.xml"
58
66
  end
59
67
 
60
68
  ##
61
69
  # Shortcut to jira seraph-config.xml file
62
70
  #
63
71
  def seraph_config_xml()
64
- "#{build_dir}/src/jira/WEB-INF/classes/seraph-config.xml"
72
+ "#{build_dir}/src/webapp/WEB-INF/classes/seraph-config.xml"
65
73
  end
66
74
 
67
75
  def web_xml_token()
@@ -72,6 +80,10 @@ module UcbDeployer
72
80
  "com.atlassian.seraph.auth.DefaultAuthenticator"
73
81
  end
74
82
 
83
+ def entityengine_xml_token()
84
+ "field-type-name=\"hsql\""
85
+ end
86
+
75
87
  def seraph_config_xml_logout_url_token()
76
88
  "/secure/Logout!default.jspa"
77
89
  end
@@ -83,6 +95,10 @@ module UcbDeployer
83
95
  def cas_logout_url()
84
96
  "/casLogout.action"
85
97
  end
98
+
99
+ def entityengine_db()
100
+ "postgres72"
101
+ end
86
102
 
87
103
  ##
88
104
  # Updates the jira web.xml file with the soulwing (CAS library)
@@ -104,7 +120,29 @@ module UcbDeployer
104
120
  web_xml.each { |line| io.puts(line) }
105
121
  end
106
122
  end
107
-
123
+
124
+ ##
125
+ # Updates the jira entityengine.xml file with the correct database configs
126
+ #
127
+ def config_entityengine_xml()
128
+ ee_xml = File.readlines(self.entityengine_xml)
129
+
130
+ ee_xml = ee_xml.map do |line|
131
+ if m = /(#{Regexp.quote(entityengine_xml_token)})/.match(line)
132
+ debug(m[0])
133
+ new_str = "#{m.pre_match}#{entityengine_db}#{m.post_match}"
134
+ debug(new_str)
135
+ new_str
136
+ else
137
+ line
138
+ end
139
+ end
140
+
141
+ File.open(self.entityengine_xml, "w") do |io|
142
+ ee_xml.each { |line| io.puts(line) }
143
+ end
144
+ end
145
+
108
146
  ##
109
147
  # Updates the jira seraph_config.xml file with the soulwing
110
148
  # authenticator.
@@ -134,10 +172,11 @@ module UcbDeployer
134
172
  end
135
173
 
136
174
  def reshuffle_jars()
175
+ FileUtils.mkdir_p("#{build_dir}/src/edit-webapp/WEB-INF/lib/")
137
176
  FileUtils.cp(Dir["#{UcbDeployer::RESOURCES_DIR}/lib/jotm-2.0.13/lib/*"],
138
- "#{build_dir}/src/jira/WEB-INF/lib/")
177
+ "#{build_dir}/src/edit-webapp/WEB-INF/lib/")
139
178
  FileUtils.cp(Dir["#{UcbDeployer::RESOURCES_DIR}/soulwing-casclient-*"],
140
- "#{build_dir}/src/jira/WEB-INF/lib/")
179
+ "#{build_dir}/src/edit-webapp/WEB-INF/lib/")
141
180
  end
142
181
 
143
182
  end
@@ -27,13 +27,16 @@ Spec::Runner.configure do |config|
27
27
  "#{dir}/confluence/src/confluence/WEB-INF/classes")
28
28
 
29
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")
30
+ FileUtils.mkdir_p("#{dir}/jira/src/webapp/WEB-INF/classes")
31
+ FileUtils.mkdir_p("#{dir}/jira/src/edit-webapp/WEB-INF/classes")
32
+ FileUtils.mkdir_p("#{dir}/jira/src/webapp/WEB-INF/lib")
32
33
 
33
34
  FileUtils.cp("#{pwd}/fixtures/jira/web.xml",
34
- "#{dir}/jira/src/jira/WEB-INF")
35
+ "#{dir}/jira/src/webapp/WEB-INF")
35
36
  FileUtils.cp("#{pwd}/fixtures/jira/seraph-config.xml",
36
- "#{dir}/jira/src/jira/WEB-INF/classes")
37
+ "#{dir}/jira/src/webapp/WEB-INF/classes")
38
+ FileUtils.cp("#{pwd}/fixtures/jira/entityengine.xml",
39
+ "#{dir}/jira/src/edit-webapp/WEB-INF/classes")
37
40
  end
38
41
 
39
42
  config.after(:all) do
@@ -59,14 +59,30 @@ describe UcbDeployer::JiraDeployer do
59
59
  end
60
60
  end
61
61
 
62
+
63
+ describe "#config_entityengine_xml" do
64
+ it "should configure the postgres72 db option in entityengine.xml" do
65
+ @cdep.build_dir = test_build_dir
66
+ # just checking if spec_helper did the right
67
+ File.exists?(@cdep.entityengine_xml).should be_true
68
+
69
+ @cdep.config_entityengine_xml
70
+ File.exists?(@cdep.entityengine_xml).should be_true
71
+ lines = File.readlines(@cdep.entityengine_xml)
72
+ lines.any? { |l| l =~ /<entity-config>/ }.should be_true
73
+ lines.any? { |l| l =~ /#{Regexp.quote(@cdep.entityengine_db)}/ }.should be_true
74
+ lines.any? { |l| l =~ /<\/entity-config>/ }.should be_true
75
+ end
76
+ end
77
+
62
78
 
63
79
  describe "#reshuffle_jars" do
64
80
  it "should work" do
65
81
  @cdep.build_dir = test_build_dir
66
82
  @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
83
+ Dir["#{@cdep.build_dir}/src/edit-webapp/WEB-INF/lib/soulwing-casclient-*"].should_not be_empty
84
+ Dir["#{@cdep.build_dir}/src/edit-webapp/WEB-INF/lib/jotm*"].should_not be_empty
85
+ Dir["#{@cdep.build_dir}/src/edit-webapp/WEB-INF/lib/carol*"].should_not be_empty
70
86
  end
71
87
  end
72
88
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ucb_deployer}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
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"]
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steven Hansen