ucb_deployer 0.0.1 → 0.0.2
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/Manifest +19 -15
- data/README.txt +67 -0
- data/Rakefile +1 -3
- data/TODO.txt +5 -0
- data/bin/deployer +6 -5
- data/lib/ucb_deployer/confluence_deployer.rb +150 -0
- data/lib/ucb_deployer/deployer.rb +115 -0
- data/lib/ucb_deployer/jira_deployer.rb +77 -0
- data/lib/ucb_deployer.rb +46 -0
- data/{cas_web.xml → resources/confluence_cas_web.xml} +2 -1
- data/resources/jdom.jar +0 -0
- data/resources/jira_cas_web.xml +95 -0
- data/resources/soulwing-casclient-0.5.3.jar +0 -0
- data/spec/fixtures/{bad_dot_cdeprc → confluence/bad_deploy.yml} +0 -0
- data/spec/{build/confluence/src/confluence/WEB-INF/classes → fixtures/confluence}/confluence-init.properties +0 -0
- data/spec/fixtures/{dot_cdeprc → confluence/deploy.yml} +1 -1
- data/spec/{build/confluence/src/confluence/WEB-INF/classes → fixtures/confluence}/seraph-config.xml +0 -0
- data/spec/{build/confluence/src/confluence/WEB-INF → fixtures/confluence}/web.xml +0 -0
- data/spec/{build/confluence/lib/soulwing-casclient-x.x.x.jar → fixtures/jira/web.xml} +0 -0
- data/spec/spec_helper.rb +11 -9
- data/spec/{confluence_deployer → ucb_deployer}/confluence_deployer_spec.rb +21 -17
- data/spec/{build/confluence/src/confluence/WEB-INF/lib/postgresql-x.x.x.jar → ucb_deployer/jira_deployer_spec.rb} +0 -0
- data/spec/{build/confluence/src/confluence/WEB-INF/lib/soulwing-casclient-x.x.x.jar → ucb_deployer/ucb_deployer_spec.rb} +0 -0
- data/ucb_deployer.gemspec +4 -4
- metadata +27 -20
- data/lib/confluence_deployer.rb +0 -228
- data/spec/fixtures/confluence-init.properties +0 -41
- data/spec/fixtures/seraph-config.xml +0 -46
- data/spec/fixtures/web.xml +0 -1016
data/spec/spec_helper.rb
CHANGED
@@ -4,7 +4,8 @@ require 'spec'
|
|
4
4
|
require 'pp'
|
5
5
|
|
6
6
|
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
|
7
|
-
require '
|
7
|
+
require 'ucb_deployer'
|
8
|
+
|
8
9
|
|
9
10
|
TEST_BUILD_DIR = File.expand_path(File.dirname(__FILE__) + "/build") unless defined?(TEST_BUILD_DIR)
|
10
11
|
|
@@ -12,19 +13,20 @@ Spec::Runner.configure do |config|
|
|
12
13
|
config.before(:all) do
|
13
14
|
dir = TEST_BUILD_DIR
|
14
15
|
pwd = File.expand_path(File.dirname(__FILE__))
|
15
|
-
FileUtils.mkdir_p("#{dir}/confluence/lib")
|
16
|
-
FileUtils.touch("#{dir}/confluence/lib/soulwing-casclient-x.x.x.jar")
|
17
16
|
|
17
|
+
FileUtils.mkdir_p("#{dir}/confluence/src/confluence/WEB-INF/classes")
|
18
18
|
FileUtils.mkdir_p("#{dir}/confluence/src/confluence/WEB-INF/lib")
|
19
|
-
FileUtils.touch("#{dir}/confluence/src/confluence/WEB-INF/lib/postgresql-x.x.x.jar")
|
20
19
|
|
21
|
-
FileUtils.
|
22
|
-
|
23
|
-
FileUtils.cp("#{pwd}/fixtures/seraph-config.xml",
|
24
|
-
|
20
|
+
FileUtils.cp("#{pwd}/fixtures/confluence/web.xml",
|
21
|
+
"#{dir}/confluence/src/confluence/WEB-INF")
|
22
|
+
FileUtils.cp("#{pwd}/fixtures/confluence/seraph-config.xml",
|
23
|
+
"#{dir}/confluence/src/confluence/WEB-INF/classes")
|
24
|
+
FileUtils.cp("#{pwd}/fixtures/confluence/confluence-init.properties",
|
25
|
+
"#{dir}/confluence/src/confluence/WEB-INF/classes")
|
25
26
|
end
|
26
27
|
|
27
28
|
config.after(:all) do
|
28
|
-
|
29
|
+
FileUtils.rm_rf("#{TEST_BUILD_DIR}/confluence")
|
30
|
+
FileUtils.rm_rf("#{TEST_BUILD_DIR}/jira")
|
29
31
|
end
|
30
32
|
end
|
@@ -1,30 +1,34 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
|
-
describe ConfluenceDeployer do
|
3
|
+
describe UcbDeployer::ConfluenceDeployer do
|
4
|
+
|
4
5
|
before(:each) do
|
5
|
-
@
|
6
|
-
@
|
7
|
-
@cdep = ConfluenceDeployer.new(@
|
6
|
+
@deploy_file = File.expand_path(File.dirname(__FILE__) + '/../fixtures/confluence/deploy.yml')
|
7
|
+
@bad_deploy_file = File.expand_path(File.dirname(__FILE__) + '/../fixtures/confluence/bad_deploy.yml')
|
8
|
+
@cdep = UcbDeployer::ConfluenceDeployer.new(@deploy_file)
|
8
9
|
end
|
9
10
|
|
11
|
+
def test_build_dir
|
12
|
+
"#{TEST_BUILD_DIR}/confluence"
|
13
|
+
end
|
10
14
|
|
11
15
|
describe "#load_config" do
|
12
16
|
it "should load configuration options" do
|
13
|
-
@cdep.build_dir.should == "/path/to/build_dir"
|
17
|
+
@cdep.build_dir.should == "/path/to/build_dir/confluence"
|
14
18
|
@cdep.deploy_dir.should == "/path/to/deploy_dir"
|
15
19
|
@cdep.war_name.should == "war_name"
|
16
20
|
@cdep.svn_project_url.should == "svn.berkeley.edu/svn/ist-svn/berkeley/projects/ist/as/webapps/confluence_archives/tags"
|
17
21
|
end
|
18
22
|
|
19
23
|
it "should raise error for invalid config options" do
|
20
|
-
lambda { @cdep.load_config(@
|
24
|
+
lambda { @cdep.load_config(@bad_deploy_file) }.should raise_error(UcbDeployer::ConfigError)
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
|
25
29
|
describe "#config_web_xml" do
|
26
30
|
it "should configure souldwing (CAS auth) in web.xml" do
|
27
|
-
@cdep.build_dir =
|
31
|
+
@cdep.build_dir = test_build_dir
|
28
32
|
# just checking if spec_helper did the right
|
29
33
|
File.exists?(@cdep.web_xml).should be_true
|
30
34
|
|
@@ -42,7 +46,7 @@ describe ConfluenceDeployer do
|
|
42
46
|
|
43
47
|
describe "#config_seraph_config_xml" do
|
44
48
|
it "should configure the soulwing (CAS) authenticator in seraph_config.xml" do
|
45
|
-
@cdep.build_dir =
|
49
|
+
@cdep.build_dir = test_build_dir
|
46
50
|
# just checking if spec_helper did the right
|
47
51
|
File.exists?(@cdep.seraph_config_xml).should be_true
|
48
52
|
|
@@ -58,32 +62,32 @@ describe ConfluenceDeployer do
|
|
58
62
|
|
59
63
|
describe "#config_confluence_init_props" do
|
60
64
|
it "should configure confluence-init.properties" do
|
61
|
-
@cdep.build_dir =
|
65
|
+
@cdep.build_dir = test_build_dir
|
62
66
|
# just checking if spec_helper did the right
|
63
67
|
File.exists?(@cdep.confluence_init_properties).should be_true
|
64
68
|
|
65
69
|
@cdep.config_confluence_init_properties
|
66
70
|
File.exists?(@cdep.confluence_init_properties).should be_true
|
67
71
|
lines = File.readlines(@cdep.confluence_init_properties)
|
68
|
-
lines.any? { |l| l =~ /confluence.home=#{@cdep.
|
72
|
+
lines.any? { |l| l =~ /confluence.home=#{@cdep.data_dir}/ }.should be_true
|
69
73
|
end
|
70
74
|
end
|
71
75
|
|
72
76
|
|
73
77
|
describe "#reshuffle_jars" do
|
74
78
|
it "should work" do
|
75
|
-
@cdep.build_dir =
|
79
|
+
@cdep.build_dir = test_build_dir
|
76
80
|
@cdep.reshuffle_jars
|
77
|
-
Dir["#{@cdep.build_dir}/
|
78
|
-
Dir["#{@cdep.build_dir}/
|
81
|
+
Dir["#{@cdep.build_dir}/src/confluence/WEB-INF/lib/soulwing-casclient-*"].should_not be_empty
|
82
|
+
Dir["#{@cdep.build_dir}/src/confluence/WEB-INF/lib/postgresql-*"].should be_empty
|
79
83
|
end
|
80
84
|
end
|
81
85
|
|
82
86
|
|
83
87
|
describe "#build" do
|
84
88
|
it "should work" do
|
85
|
-
@cdep.build_dir =
|
86
|
-
@cdep.should_receive(:exec).with("sh #{@cdep.build_dir}/
|
89
|
+
@cdep.build_dir = test_build_dir
|
90
|
+
@cdep.should_receive(:exec).with("sh #{@cdep.build_dir}/src/build.sh")
|
87
91
|
@cdep.build
|
88
92
|
end
|
89
93
|
end
|
@@ -91,8 +95,8 @@ describe ConfluenceDeployer do
|
|
91
95
|
|
92
96
|
describe "#export" do
|
93
97
|
it "should work" do
|
94
|
-
cdep = ConfluenceDeployer.new(@
|
95
|
-
cdep.build_dir =
|
98
|
+
cdep = UcbDeployer::ConfluenceDeployer.new(@deploy_file)
|
99
|
+
cdep.build_dir = test_build_dir
|
96
100
|
cdep.version = "3.2.1_01"
|
97
101
|
arg = "svn export svn+ssh://#{cdep.svn_username}@#{cdep.svn_project_url}/confluence-#{cdep.version}"
|
98
102
|
cdep.should_receive("`").with(arg).and_return(nil)
|
File without changes
|
File without changes
|
data/ucb_deployer.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{ucb_deployer}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.2"
|
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-
|
9
|
+
s.date = %q{2010-10-22}
|
10
10
|
s.default_executable = %q{deployer}
|
11
11
|
s.description = %q{Tool for deploying java applications}
|
12
12
|
s.email = %q{runner@berkeley.edu}
|
13
13
|
s.executables = ["deployer"]
|
14
|
-
s.extra_rdoc_files = ["README.txt", "lib/confluence_deployer.rb"]
|
15
|
-
s.files = ["README.txt", "Rakefile", "bin/deployer", "
|
14
|
+
s.extra_rdoc_files = ["README.txt", "lib/ucb_deployer.rb", "lib/ucb_deployer/confluence_deployer.rb", "lib/ucb_deployer/deployer.rb", "lib/ucb_deployer/jira_deployer.rb"]
|
15
|
+
s.files = ["Manifest", "README.txt", "Rakefile", "TODO.txt", "bin/deployer", "lib/ucb_deployer.rb", "lib/ucb_deployer/confluence_deployer.rb", "lib/ucb_deployer/deployer.rb", "lib/ucb_deployer/jira_deployer.rb", "resources/confluence_cas_web.xml", "resources/jdom.jar", "resources/jira_cas_web.xml", "resources/soulwing-casclient-0.5.3.jar", "spec/fixtures/confluence/bad_deploy.yml", "spec/fixtures/confluence/confluence-init.properties", "spec/fixtures/confluence/deploy.yml", "spec/fixtures/confluence/seraph-config.xml", "spec/fixtures/confluence/web.xml", "spec/fixtures/jira/web.xml", "spec/spec_helper.rb", "spec/ucb_deployer/confluence_deployer_spec.rb", "spec/ucb_deployer/jira_deployer_spec.rb", "spec/ucb_deployer/ucb_deployer_spec.rb", "ucb_deployer.gemspec"]
|
16
16
|
s.homepage = %q{http://ucbrb.rubyforge.org}
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Ucb_deployer", "--main", "README.txt"]
|
18
18
|
s.require_paths = ["lib"]
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
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-
|
18
|
+
date: 2010-10-22 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -27,27 +27,34 @@ extensions: []
|
|
27
27
|
|
28
28
|
extra_rdoc_files:
|
29
29
|
- README.txt
|
30
|
-
- lib/
|
30
|
+
- lib/ucb_deployer.rb
|
31
|
+
- lib/ucb_deployer/confluence_deployer.rb
|
32
|
+
- lib/ucb_deployer/deployer.rb
|
33
|
+
- lib/ucb_deployer/jira_deployer.rb
|
31
34
|
files:
|
35
|
+
- Manifest
|
32
36
|
- README.txt
|
33
37
|
- Rakefile
|
38
|
+
- TODO.txt
|
34
39
|
- bin/deployer
|
35
|
-
-
|
36
|
-
- lib/confluence_deployer.rb
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
- spec/
|
44
|
-
- spec/fixtures/
|
45
|
-
- spec/fixtures/confluence
|
46
|
-
- spec/fixtures/
|
47
|
-
- spec/fixtures/
|
48
|
-
- spec/fixtures/web.xml
|
40
|
+
- lib/ucb_deployer.rb
|
41
|
+
- lib/ucb_deployer/confluence_deployer.rb
|
42
|
+
- lib/ucb_deployer/deployer.rb
|
43
|
+
- lib/ucb_deployer/jira_deployer.rb
|
44
|
+
- resources/confluence_cas_web.xml
|
45
|
+
- resources/jdom.jar
|
46
|
+
- resources/jira_cas_web.xml
|
47
|
+
- resources/soulwing-casclient-0.5.3.jar
|
48
|
+
- spec/fixtures/confluence/bad_deploy.yml
|
49
|
+
- spec/fixtures/confluence/confluence-init.properties
|
50
|
+
- spec/fixtures/confluence/deploy.yml
|
51
|
+
- spec/fixtures/confluence/seraph-config.xml
|
52
|
+
- spec/fixtures/confluence/web.xml
|
53
|
+
- spec/fixtures/jira/web.xml
|
49
54
|
- spec/spec_helper.rb
|
50
|
-
-
|
55
|
+
- spec/ucb_deployer/confluence_deployer_spec.rb
|
56
|
+
- spec/ucb_deployer/jira_deployer_spec.rb
|
57
|
+
- spec/ucb_deployer/ucb_deployer_spec.rb
|
51
58
|
- ucb_deployer.gemspec
|
52
59
|
has_rdoc: true
|
53
60
|
homepage: http://ucbrb.rubyforge.org
|
data/lib/confluence_deployer.rb
DELETED
@@ -1,228 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'net/http'
|
3
|
-
require 'erb'
|
4
|
-
|
5
|
-
class ConfluenceDeployer
|
6
|
-
class ConfigError < RuntimeError; end
|
7
|
-
|
8
|
-
DEPLOYER_HOME = File.expand_path(File.dirname(__FILE__) + '/..') unless defined?(DEPLOYER_HOME)
|
9
|
-
CONFIG_OPTIONS = [
|
10
|
-
:build_dir,
|
11
|
-
:deploy_dir,
|
12
|
-
:war_name,
|
13
|
-
:cas_service_url,
|
14
|
-
:cas_server_url,
|
15
|
-
:confluence_home_dir,
|
16
|
-
:svn_username,
|
17
|
-
:svn_project_url,
|
18
|
-
]
|
19
|
-
|
20
|
-
attr_accessor *CONFIG_OPTIONS
|
21
|
-
attr_accessor :version, :debug_mode
|
22
|
-
|
23
|
-
def initialize(config_file = "~/cdeprc")
|
24
|
-
FileUtils.touch(config_file) if !File.exists?(config_file)
|
25
|
-
load_config(config_file)
|
26
|
-
end
|
27
|
-
|
28
|
-
##
|
29
|
-
# Configuration options are:
|
30
|
-
#
|
31
|
-
# +build_dir+
|
32
|
-
# +deploy_dir+
|
33
|
-
# +war_name+
|
34
|
-
# +svn_project_url+
|
35
|
-
# +svn_username+
|
36
|
-
# +cas_service_url+
|
37
|
-
# +cas_server_url+
|
38
|
-
# +confluence_home_dir+
|
39
|
-
#
|
40
|
-
def load_config(config_file)
|
41
|
-
hash = YAML.load_file(config_file)
|
42
|
-
hash.each do |k, v|
|
43
|
-
CONFIG_OPTIONS.include?(k.to_sym) ? self.send("#{k}=", v) : raise(ConfigError, "Unrecognized Option: #{k}")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def export()
|
48
|
-
debug("Exporting from: #{svn_project_url}")
|
49
|
-
pwd = Dir.getwd
|
50
|
-
Dir.chdir("#{build_dir}/confluence")
|
51
|
-
`svn export svn+ssh://#{svn_username}@#{svn_project_url}/confluence-#{version}`
|
52
|
-
FileUtils.mv("confluence-#{version}", "src")
|
53
|
-
Dir.chdir(pwd)
|
54
|
-
$stdout.puts("Export Completed")
|
55
|
-
end
|
56
|
-
|
57
|
-
def configure
|
58
|
-
config_web_xml
|
59
|
-
config_seraph_config_xml
|
60
|
-
config_confluence_init_properties
|
61
|
-
reshuffle_jars
|
62
|
-
end
|
63
|
-
|
64
|
-
def build
|
65
|
-
exec("sh #{build_dir}/confluence/src/build.sh")
|
66
|
-
end
|
67
|
-
|
68
|
-
def deploy
|
69
|
-
display_maintenance_file
|
70
|
-
FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}*"])
|
71
|
-
FileUtils.mkdir("#{deploy_dir}/#{war_name}")
|
72
|
-
FileUtils.cp(Dir["#{build_dir}/confluence/src/dist/*.war"], "#{deploy_dir}/#{war_name}")
|
73
|
-
exec("jar -xvf #{deploy_dir}/#{war_name}/#{war_name}.war")
|
74
|
-
FileUtils.rm("#{deploy_dir}/#{war_name}/#{war_name}.war")
|
75
|
-
end
|
76
|
-
|
77
|
-
def rollback
|
78
|
-
end
|
79
|
-
|
80
|
-
def svn_username
|
81
|
-
@svn_username || "app_relmgt"
|
82
|
-
end
|
83
|
-
|
84
|
-
def svn_base_url
|
85
|
-
@svn_base_url || "svn.berkeley.edu/svn/ist-svn/berkeley/projects/ist/as/webapps/confluence_archives"
|
86
|
-
end
|
87
|
-
|
88
|
-
##
|
89
|
-
# Shortcut to confluence web.xml file
|
90
|
-
#
|
91
|
-
def web_xml()
|
92
|
-
"#{build_dir}/confluence/src/confluence/WEB-INF/web.xml"
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# Shortcut to confluence seraph-config.xml file
|
97
|
-
#
|
98
|
-
def seraph_config_xml()
|
99
|
-
"#{build_dir}/confluence/src/confluence/WEB-INF/classes/seraph-config.xml"
|
100
|
-
end
|
101
|
-
|
102
|
-
##
|
103
|
-
# Shortcut to confluence confluence-init.properties file
|
104
|
-
#
|
105
|
-
def confluence_init_properties()
|
106
|
-
"#{build_dir}/confluence/src/confluence/WEB-INF/classes/confluence-init.properties"
|
107
|
-
end
|
108
|
-
|
109
|
-
def web_xml_token()
|
110
|
-
"<!-- Uncomment the following to disable the space export long running task. -->"
|
111
|
-
end
|
112
|
-
|
113
|
-
def seraph_config_xml_token()
|
114
|
-
"com.atlassian.confluence.user.ConfluenceAuthenticator"
|
115
|
-
end
|
116
|
-
|
117
|
-
def cas_authenticator_class()
|
118
|
-
"org.soulwing.cas.apps.atlassian.ConfluenceCasAuthenticator"
|
119
|
-
end
|
120
|
-
|
121
|
-
##
|
122
|
-
# Updates the confluence 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}/cas_web.xml") { |f| f.read }
|
131
|
-
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
|
-
##
|
143
|
-
# Updates the confluence seraph_config.xml file with the soulwing
|
144
|
-
# authenticator.
|
145
|
-
#
|
146
|
-
def config_seraph_config_xml()
|
147
|
-
seraph_xml = File.readlines(self.seraph_config_xml)
|
148
|
-
|
149
|
-
seraph_xml = seraph_xml.map do |line|
|
150
|
-
if m = /(#{Regexp.quote(seraph_config_xml_token)})/.match(line)
|
151
|
-
puts m[0]
|
152
|
-
puts "#{m.pre_match}#{cas_authenticator_class}#{m.post_match}"
|
153
|
-
"#{m.pre_match}#{cas_authenticator_class}#{m.post_match}"
|
154
|
-
else
|
155
|
-
line
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
File.open(self.seraph_config_xml, "w") do |io|
|
160
|
-
seraph_xml.each { |line| io.puts(line) }
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
##
|
165
|
-
# Sets the confluence.home property in the file: confluence-init.properties
|
166
|
-
#
|
167
|
-
def config_confluence_init_properties()
|
168
|
-
File.open(self.confluence_init_properties, "w") { |io| io.puts("confluence.home=#{confluence_home_dir}") }
|
169
|
-
end
|
170
|
-
|
171
|
-
def reshuffle_jars()
|
172
|
-
FileUtils.cp(Dir["#{build_dir}/confluence/lib/soulwing-casclient-*"],
|
173
|
-
"#{build_dir}/confluence/src/confluence/WEB-INF/lib")
|
174
|
-
FileUtils.rm_rf(Dir["#{build_dir}/confluence/src/confluence/WEB-INF/lib/postgresql-*"])
|
175
|
-
end
|
176
|
-
|
177
|
-
def debug(str)
|
178
|
-
if debug_mode
|
179
|
-
$stdout.puts(str)
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
def display_maintenance_file()
|
184
|
-
maint_start = Time.now.strftime("%m-%d-%Y %H:%M:%S")
|
185
|
-
template = ERB.new(maintenance_template)
|
186
|
-
File.open("/var/www/html/confluence/maintenance.html", "w") do |f|
|
187
|
-
f.puts template.result(binding)
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
def maintenance_template()
|
192
|
-
%q{
|
193
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
194
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
195
|
-
|
196
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
197
|
-
|
198
|
-
<head>
|
199
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
200
|
-
<title>Site Maintenance<title>
|
201
|
-
<style type="text/css">
|
202
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
203
|
-
div.dialog {
|
204
|
-
width: 35em;
|
205
|
-
padding: 0 3em;
|
206
|
-
margin: 3em auto 0 auto;
|
207
|
-
border: 1px solid #ccc;
|
208
|
-
border-right-color: #999;
|
209
|
-
border-bottom-color: #999;
|
210
|
-
}
|
211
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
212
|
-
</style>
|
213
|
-
</head>
|
214
|
-
|
215
|
-
<body>
|
216
|
-
<div class="dialog">
|
217
|
-
<h1>Site Maintenance</h1>
|
218
|
-
<p>
|
219
|
-
The site is down for maintenance as of: <strong><%= maint_start %></strong> <br/>
|
220
|
-
it should be available shortly.
|
221
|
-
</p>
|
222
|
-
</div>
|
223
|
-
</body>
|
224
|
-
</html>
|
225
|
-
}
|
226
|
-
end
|
227
|
-
|
228
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# This file allows you to set the directory for Confluence to store its configuration files.
|
2
|
-
#
|
3
|
-
###########################
|
4
|
-
# Note for Windows Users #
|
5
|
-
###########################
|
6
|
-
#
|
7
|
-
# Each backslash in your path must be written as a forward slash.
|
8
|
-
# - For example:
|
9
|
-
# c:\confluence\data
|
10
|
-
#
|
11
|
-
# should be written as:
|
12
|
-
#
|
13
|
-
# c:/confluence/data
|
14
|
-
|
15
|
-
###########################
|
16
|
-
# Note for Unix Users #
|
17
|
-
###########################
|
18
|
-
# - For example:
|
19
|
-
# confluence.home=/var/confluence
|
20
|
-
#
|
21
|
-
# NOTE: If the path of your confluence.home directory contains symlinks,
|
22
|
-
# please set confluence.home to the absolute path, otherwise problems may occur.
|
23
|
-
# - For example:
|
24
|
-
# confluence.home=/data/confluence/ (where /data is a symlink to -> /var/data/)
|
25
|
-
# should be written as:
|
26
|
-
# confluence.home=/var/data/confluence/
|
27
|
-
|
28
|
-
###########################
|
29
|
-
# Configuration Directory #
|
30
|
-
###########################
|
31
|
-
|
32
|
-
# specify your directory below (don't forget to remove the '#' in front)
|
33
|
-
|
34
|
-
# confluence.home=c:/confluence/data
|
35
|
-
|
36
|
-
###########################
|
37
|
-
# Daily Backups Directory #
|
38
|
-
###########################
|
39
|
-
|
40
|
-
## Set this to true to enable setting of the daily backups directory in the admin section.
|
41
|
-
#confluence.backup.path.set.allowed=false
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<security-config>
|
2
|
-
<parameters>
|
3
|
-
<init-param>
|
4
|
-
<param-name>login.url</param-name>
|
5
|
-
<param-value>/login.action?os_destination=${originalurl}</param-value>
|
6
|
-
</init-param>
|
7
|
-
<init-param>
|
8
|
-
<param-name>link.login.url</param-name>
|
9
|
-
<param-value>/login.action</param-value>
|
10
|
-
</init-param>
|
11
|
-
<init-param>
|
12
|
-
<param-name>cookie.encoding</param-name>
|
13
|
-
<param-value>cNf</param-value>
|
14
|
-
</init-param>
|
15
|
-
<init-param>
|
16
|
-
<param-name>login.cookie.key</param-name>
|
17
|
-
<param-value>seraph.confluence</param-value>
|
18
|
-
</init-param>
|
19
|
-
|
20
|
-
<!--only basic authentication available-->
|
21
|
-
<init-param>
|
22
|
-
<param-name>authentication.type</param-name>
|
23
|
-
<param-value>os_authType</param-value>
|
24
|
-
</init-param>
|
25
|
-
</parameters>
|
26
|
-
|
27
|
-
<rolemapper class="com.atlassian.confluence.security.ConfluenceRoleMapper"/>
|
28
|
-
<controller class="com.atlassian.confluence.setup.seraph.ConfluenceSecurityController"/>
|
29
|
-
<authenticator class="com.atlassian.confluence.user.ConfluenceAuthenticator"/>
|
30
|
-
|
31
|
-
<services>
|
32
|
-
<service class="com.atlassian.seraph.service.PathService">
|
33
|
-
<init-param>
|
34
|
-
<param-name>config.file</param-name>
|
35
|
-
<param-value>seraph-paths.xml</param-value>
|
36
|
-
</init-param>
|
37
|
-
</service>
|
38
|
-
</services>
|
39
|
-
|
40
|
-
<elevatedsecurityguard class="com.atlassian.confluence.security.seraph.ConfluenceElevatedSecurityGuard"/>
|
41
|
-
|
42
|
-
<interceptors>
|
43
|
-
<interceptor name="session-invalidator" class="com.atlassian.confluence.security.seraph.SessionInvalidatingLoginInterceptor"/>
|
44
|
-
<interceptor name="login-logger" class="com.atlassian.confluence.user.ConfluenceLoginInterceptor"/>
|
45
|
-
</interceptors>
|
46
|
-
</security-config>
|