ucb_deployer 0.0.8 → 0.0.9

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.0.8') do |p|
6
+ Echoe.new('ucb_deployer', '0.0.9') 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"
@@ -4,11 +4,12 @@ module UcbDeployer
4
4
 
5
5
  def initialize(config_file = "#{ENV['HOME']}/config/confluence/deploy.yml")
6
6
  debug("Using config file: #{config_file}")
7
+ debug("")
7
8
  load_config(config_file)
8
9
  end
9
10
 
10
11
  def export()
11
- UcbDeployer.debug("Exporting from: #{svn_project_url}")
12
+ UcbDeployer.debug("Exporting from: #{svn_project_url}/confluence-#{version}")
12
13
  pwd = Dir.getwd
13
14
  Dir.chdir("#{build_dir}")
14
15
  FileUtils.rm_rf("#{build_dir}/src")
@@ -28,16 +29,16 @@ module UcbDeployer
28
29
  def build
29
30
  pwd = Dir.getwd
30
31
  Dir.chdir("#{build_dir}/src")
31
- exec("sh #{build_dir}/src/build.sh")
32
+ `sh #{build_dir}/src/build.sh`
32
33
  Dir.chdir(pwd)
33
34
  end
34
35
 
35
36
  def deploy
36
- display_maintenance_file
37
+ display_maintenance_file if maintenance_file_dir
37
38
  FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}*"])
38
39
  FileUtils.mkdir("#{deploy_dir}/#{war_name}")
39
40
  FileUtils.cp(Dir["#{build_dir}/src/dist/*.war"], "#{deploy_dir}/#{war_name}")
40
- exec("jar -xvf #{deploy_dir}/#{war_name}/#{war_name}.war")
41
+ `jar -xvf #{deploy_dir}/#{war_name}/#{war_name}.war`
41
42
  FileUtils.rm("#{deploy_dir}/#{war_name}/#{war_name}.war")
42
43
  end
43
44
 
@@ -15,6 +15,7 @@ module UcbDeployer
15
15
  :cas_service_url,
16
16
  :cas_server_url,
17
17
  :data_dir,
18
+ :maintenance_file_dir,
18
19
  :svn_username,
19
20
  :svn_project_url,
20
21
  ]
@@ -53,12 +54,14 @@ module UcbDeployer
53
54
  # +svn_username+
54
55
  # +cas_service_url+
55
56
  # +cas_server_url+
57
+ # +maintenance_file_dir+
56
58
  # +data_dir+
57
59
  #
58
60
  def load_config(config_file)
59
61
  hash = YAML.load_file(config_file)
60
62
 
61
- debug("Setting options:")
63
+ debug("Config options:")
64
+ debug("")
62
65
  hash.each do |key, val|
63
66
  debug("#{key}: #{val}")
64
67
  if CONFIG_OPTIONS.include?(key.to_sym)
@@ -72,7 +75,7 @@ module UcbDeployer
72
75
  def display_maintenance_file()
73
76
  maint_start = Time.now.strftime("%m-%d-%Y %H:%M:%S")
74
77
  template = ERB.new(maintenance_template)
75
- File.open("/var/www/html/confluence/maintenance.html", "w") do |f|
78
+ File.open(maintenance_file_dir(), "w") do |f|
76
79
  f.puts template.result(binding)
77
80
  end
78
81
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ucb_deployer}
5
- s.version = "0.0.8"
5
+ s.version = "0.0.9"
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steven Hansen