ienders-tomcap 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/History.txt ADDED
@@ -0,0 +1,2 @@
1
+ == 0.1 / 2009-08-24
2
+ * Created gem. Touching to get github to detect gemspec.
data/Manifest.txt ADDED
@@ -0,0 +1,6 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ lib/tomcap.rb
6
+ lib/tomcap/recipes.rb
data/README.txt ADDED
@@ -0,0 +1,26 @@
1
+ = tomcap
2
+
3
+ == DESCRIPTION:
4
+
5
+ Capistrano tasks which allow you to quickly and easily deploy Java WAR files located in remote repositories (currently Artifactory repos) to a running Tomcat container.
6
+
7
+ == REQUIREMENTS:
8
+
9
+ * capistrano (http://capify.org)
10
+ * Access to an Artifactory repository
11
+ * Some Java code you want to deploy (in WAR format) hosted in your Artifactory Maven repo.
12
+ * A running Tomcat container. The manager port does not need to be open from your local machine. (Otherwise you could probably deploy just
13
+ as easily without using this plugin!)
14
+
15
+ == USAGE:
16
+
17
+ = Include in capistrano
18
+
19
+ In your deploy.rb, simply include this line at the top:
20
+
21
+ require 'tomcap/recipes'
22
+
23
+ == AUTHOR:
24
+
25
+ Ian Enders
26
+ addictedtoian.com
data/lib/tomcap.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Tomcap
2
+ VERSION = '0.2'
3
+ end
@@ -0,0 +1,52 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+
3
+ namespace :deploy do
4
+ task :setup_java, :roles => :java, :except => { :no_release => true } do
5
+ run "mkdir -p #{shared_path}/cached_java_copy"
6
+ end
7
+
8
+
9
+ desc <<-DESC
10
+ Deploy Java WAR to a running Tomcat container.
11
+
12
+ Required Arguments (examples specified):
13
+ set :tomcat_user, "manager"
14
+ set :tomcat_pass, "password"
15
+ set :mvn_repo_user, "artifactory"
16
+ set :mvn_repo_pass, "password"
17
+ set :mvn_repository, "libs-releases-local"
18
+ set :mvn_war_group_id, "com.mycompany"
19
+ set :mvn_war_artifact_id, "my-application"
20
+ set :mvn_war_version, "1.0-SNAPSHOT"
21
+
22
+ Optional Arguments (defaults specified):
23
+ set :tomcat_url, "http://localhost:8080"
24
+ set :artifactory_url, "http://localhost:8080/artifactory"
25
+ DESC
26
+ task :java, :roles => :java, :except => { :no_release => true } do
27
+ raise ArgumentError, "Must set tomcat_user" unless tomcat_user
28
+ raise ArgumentError, "Must set tomcat_pass" unless tomcat_pass
29
+ raise ArgumentError, "Must set mvn_repo_user" unless mvn_repo_user
30
+ raise ArgumentError, "Must set mvn_repo_pass" unless mvn_repo_pass
31
+ raise ArgumentError, "Must set mvn_repository" unless mvn_repository
32
+ raise ArgumentError, "Must set mvn_war_group_id" unless mvn_war_group_id
33
+ raise ArgumentError, "Must set mvn_war_artifact_id" unless mvn_war_artifact_id
34
+ raise ArgumentError, "Must set mvn_war_version" unless mvn_war_version
35
+
36
+ tomcat_url = fetch(:tomcat_url, "http://localhost:8080")
37
+ artifactory_url = fetch(:artifactory_url, "http://localhost:8080/artifactory")
38
+
39
+ war_path = "#{artifactory_url}/#{mvn_repository}/#{mvn_war_group_id.gsub(/\./, '/')}/#{mvn_war_artifact_id}/#{mvn_war_version}"
40
+ war_file = "#{mvn_war_artifact_id}-#{mvn_war_version}.war"
41
+
42
+ run <<-CMD
43
+ cd #{shared_path}/cached_java_copy &&
44
+ wget #{war_path}/#{war_file}" &&
45
+ curl -F "@#{war_file}" #{tomcat_url}/manager/deploy?path=#{mvn_war_artifact_id}-#{mvn_war_version}&update=true
46
+ CMD
47
+ end
48
+ end
49
+
50
+ before "deploy:java", "deploy:setup_java"
51
+
52
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ienders-tomcap
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.2"
5
+ platform: ruby
6
+ authors:
7
+ - Ian Enders
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-24 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.2.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hoe
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.5.1
34
+ version:
35
+ description: Capistrano tasks which allow you to quickly and easily deploy Java WAR files located in remote repositories (currently Artifactory repos) to a running Tomcat container.
36
+ email: ian.enders@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - History.txt
45
+ - Manifest.txt
46
+ - README.txt
47
+ - lib/tomcap.rb
48
+ - lib/tomcap/recipes.rb
49
+ has_rdoc: true
50
+ homepage: http://github.com/ienders/tomcap/tree/master
51
+ licenses:
52
+ post_install_message:
53
+ rdoc_options:
54
+ - --main
55
+ - README.txt
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ requirements: []
71
+
72
+ rubyforge_project:
73
+ rubygems_version: 1.3.5
74
+ signing_key:
75
+ specification_version: 2
76
+ summary: Tomcat deployments with Capistrano
77
+ test_files: []
78
+