ucb_deployer 0.1.6 → 0.1.7

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/README.txt CHANGED
@@ -26,12 +26,15 @@ $HOME/config/jira/deploy.yml
26
26
  Where $HOME is the home directory of the user that will be doing the deployments:
27
27
  we are using a special user __app_relmgt__ for this purpose.
28
28
 
29
- ==== Move Jars into common/lib
30
- The following jars are in $CATALINA_HOME/common/lib
29
+ ==== JIRA: Move Jars into common/lib
30
+ Make sure the following jars are in $CATALINA_HOME/common/lib
31
31
  * activation-1.0.2.jar
32
32
  * javamail-1.3.3.jar
33
33
  * postgresql-8.3-604.jdbc3.jar
34
34
 
35
+
36
+
37
+
35
38
  === Configuration
36
39
 
37
40
  The deploy.yml files for __Jira__ and __Confluence__ both accept the following options:
@@ -44,6 +47,8 @@ The deploy.yml files for __Jira__ and __Confluence__ both accept the following o
44
47
  * data_dir
45
48
  * svn_username
46
49
  * svn_project_url
50
+ * maintenance_file_dir
51
+
47
52
 
48
53
  Assuming we had the following directories setup:
49
54
  # where we deploy from
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.6') do |p|
6
+ Echoe.new('ucb_deployer', '0.1.7') 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"
data/bin/ucb_deploy CHANGED
@@ -13,19 +13,24 @@ USAGE = "Usage: deployer <task> APP=<confluence|jira> VERSION=x.x.x"
13
13
 
14
14
  task :default => :deploy
15
15
 
16
+ desc "Deploy the application"
16
17
  task :deploy => [:build] do
17
18
  @deployer.deploy()
18
19
  end
19
20
 
21
+ desc "Build the application"
20
22
  task :build => [:configure] do
21
23
  @deployer.build()
22
24
  end
23
25
 
26
+ desc "Configure the build"
24
27
  task :configure => [:export] do
25
28
  @deployer.configure()
26
29
  end
27
30
 
31
+ desc "Export code into the build directory"
28
32
  task :export => [:init] do
33
+ Rake::Task["display_maintenance_file"].invoke
29
34
  @deployer.export()
30
35
  end
31
36
 
@@ -48,4 +53,15 @@ task :check_usage do
48
53
  end
49
54
  end
50
55
 
56
+ desc "Remove the maintenance file"
57
+ task :remove_maintenance_file => [:init] do
58
+ @deployer.remove_maintenance_file()
59
+ end
60
+
61
+ desc "Display maintenance file that gets picked up by Apache"
62
+ task :display_maintenance_file => [:init] do
63
+ @deployer.display_maintenance_file()
64
+ end
65
+
66
+
51
67
  Rake.application.top_level
@@ -34,8 +34,6 @@ module UcbDeployer
34
34
  end
35
35
 
36
36
  def deploy
37
- display_maintenance_file if maintenance_file_dir
38
-
39
37
  if File.exists?("#{deploy_dir}/#{war_name}")
40
38
  FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}"])
41
39
  end
@@ -79,6 +79,7 @@ module UcbDeployer
79
79
  end
80
80
 
81
81
  def display_maintenance_file()
82
+ return unless maintenance_file_dir()
82
83
  maint_start = Time.now.strftime("%m-%d-%Y %H:%M:%S")
83
84
  template = ERB.new(maintenance_template)
84
85
  File.open("#{maintenance_file_dir}/maintenance.html", "w") do |f|
@@ -86,6 +87,11 @@ module UcbDeployer
86
87
  end
87
88
  end
88
89
 
90
+ def remove_maintenance_file()
91
+ return unless maintenance_file_dir()
92
+ FileUtils.rm("#{maintenance_file_dir}/maintenance.html")
93
+ end
94
+
89
95
  def maintenance_template()
90
96
  %q{
91
97
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -34,8 +34,6 @@ module UcbDeployer
34
34
  end
35
35
 
36
36
  def deploy()
37
- display_maintenance_file if maintenance_file_dir
38
-
39
37
  if File.exists?("#{deploy_dir}/#{war_name}")
40
38
  FileUtils.rm_rf(Dir["#{deploy_dir}/#{war_name}"])
41
39
  end
data/spec/spec_helper.rb CHANGED
@@ -30,6 +30,8 @@ Spec::Runner.configure do |config|
30
30
  FileUtils.mkdir_p("#{dir}/jira/src/webapp/WEB-INF/classes")
31
31
  FileUtils.mkdir_p("#{dir}/jira/src/edit-webapp/WEB-INF/classes")
32
32
  FileUtils.mkdir_p("#{dir}/jira/src/webapp/WEB-INF/lib")
33
+ FileUtils.touch("#{dir}/jira/src/webapp/WEB-INF/lib/activation-1.0.2.jar")
34
+ FileUtils.touch("#{dir}/jira/src/webapp/WEB-INF/lib/javamail-1.3.3.jar")
33
35
 
34
36
  FileUtils.cp("#{pwd}/fixtures/jira/web.xml",
35
37
  "#{dir}/jira/src/webapp/WEB-INF")
data/ucb_deployer.gemspec CHANGED
@@ -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.6"
5
+ s.version = "0.1.7"
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: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steven Hansen