capistrano-wordpress 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/README ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |gemspec|
4
+ gemspec.name = "capistrano-wordpress"
5
+ gemspec.summary = "Recipes for Capistrano Deployments of WordPress"
6
+ gemspec.description = "Recipes for Capistrano Deployments of WordPress"
7
+ gemspec.email = "brandonmartinez@gmail.com"
8
+ gemspec.homepage = "http://www.brandonmartinez.com/"
9
+ gemspec.authors = ["Brandon Martinez"]
10
+ end
11
+ rescue LoadError
12
+ puts "Jeweler not available. Install it with: gem install jeweler"
13
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.4
@@ -0,0 +1,42 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{capistrano-wordpress}
8
+ s.version = "0.0.4"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Brandon Martinez"]
12
+ s.date = %q{2010-03-27}
13
+ s.description = %q{Recipes for Capistrano Deployments of WordPress}
14
+ s.email = %q{brandonmartinez@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "README",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "capistrano-wordpress.gemspec",
24
+ "lib/capistrano_wordpress.rb"
25
+ ]
26
+ s.homepage = %q{http://www.brandonmartinez.com/}
27
+ s.rdoc_options = ["--charset=UTF-8"]
28
+ s.require_paths = ["lib"]
29
+ s.rubygems_version = %q{1.3.6}
30
+ s.summary = %q{Recipes for Capistrano Deployments of WordPress}
31
+
32
+ if s.respond_to? :specification_version then
33
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
34
+ s.specification_version = 3
35
+
36
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
37
+ else
38
+ end
39
+ else
40
+ end
41
+ end
42
+
@@ -0,0 +1,105 @@
1
+ #
2
+ # Credits
3
+ #
4
+
5
+ # This gem is based off the work of many others. Here are most of the references:
6
+
7
+ # http://openmonkey.com/articles/2010/01/making-your-capistrano-recipe-book
8
+ # http://railstips.org/2008/11/24/gitn-your-shared-host-on
9
+ # http://railstips.org/2008/12/14/deploying-rails-on-dreamhost-with-passenger
10
+ # http://code.whomwah.com/ruby/capistrano1/deploy.rb
11
+ # http://www.capify.org/index.php/Variables
12
+
13
+
14
+ Capistrano::Configuration.instance(:must_exist).load do
15
+
16
+ #
17
+ # Dependencies
18
+ #
19
+
20
+ require 'capistrano/recipes/deploy/scm'
21
+ require 'capistrano/recipes/deploy/strategy'
22
+
23
+
24
+ #
25
+ # Variable Assignment Method
26
+ #
27
+
28
+ def _cset(name, *args, &block)
29
+ unless exists?(name)
30
+ set(name, *args, &block)
31
+ end
32
+ end
33
+
34
+ #
35
+ # Variables
36
+ #
37
+
38
+ # User details
39
+ _cset(:user) { abort "Please specify your username for the server: set :user, 'username'" }
40
+
41
+ # Domain details
42
+ _cset(:domain) { abort "Please specify your domain name for deployment: set :domain, 'yourdomain.com'" }
43
+
44
+ # Application/Theme details
45
+ _cset (:application) { domain }
46
+ _cset (:theme_name) { abort "Please specify a theme name (no spaces, please): set :theme_name, 'themename'" }
47
+ _cset (:current_dir) { theme_name}
48
+
49
+ # SCM settings
50
+ set :appdir, "/home/#{user}/deployments/#{application}"
51
+ set :scm, 'git'
52
+ set :scm_verbose, true
53
+ set :repository, "#{user}@#{domain}:git/#{application}.git"
54
+ set :branch, 'master'
55
+ set :deploy_via, 'remote_cache'
56
+ set :git_shallow_clone, 1
57
+ set :deploy_to, "/home/#{user}/#{domain}/wp-content/themes/"
58
+ set :releases_path, "/home/#{user}/cap/#{domain}/releases/"
59
+ set :shared_path, "/home/#{user}/cap/#{domain}/shared/"
60
+ set :use_sudo, false
61
+ set :keep_releases, 100
62
+
63
+ # Git settings for capistrano
64
+ default_run_options[:pty] = true # needed for git password prompts
65
+ ssh_options[:forward_agent] = true # use the keys for the person running the cap command to check out the app
66
+
67
+ #
68
+ # Recipes
69
+ #
70
+
71
+ namespace :deploy do
72
+
73
+ # Remove normal "rails" tasks; not needed for WP
74
+ [:setup, :update, :update_code, :finalize_update, :symlink, :restart].each do |default_task|
75
+ task default_task do
76
+ # ... ahh, silence!
77
+ end
78
+ end
79
+
80
+ desc "A macro-task that updates the code and fixes the symlink."
81
+ task :default do
82
+ transaction do
83
+ update_code
84
+ symlink
85
+ end
86
+ end
87
+
88
+ task :update_code, :except => { :no_release => true } do
89
+ on_rollback { run "rm -rf #{release_path}; true" }
90
+ strategy.deploy!
91
+ end
92
+
93
+ desc "Remove the WordPress cache and killall php5 instances"
94
+ task :after_deploy do
95
+ cleanup
96
+ run "rm -rf ~/#{domain}/wp-content/cache/"
97
+ run "killall php5.cgi"
98
+ run "killall php5.cgi"
99
+ run "killall php5.cgi"
100
+ run "killall php5.cgi"
101
+ run "killall php5.cgi"
102
+ end
103
+
104
+ end
105
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-wordpress
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 4
9
+ version: 0.0.4
10
+ platform: ruby
11
+ authors:
12
+ - Brandon Martinez
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-27 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Recipes for Capistrano Deployments of WordPress
22
+ email: brandonmartinez@gmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README
29
+ files:
30
+ - .gitignore
31
+ - README
32
+ - Rakefile
33
+ - VERSION
34
+ - capistrano-wordpress.gemspec
35
+ - lib/capistrano_wordpress.rb
36
+ has_rdoc: true
37
+ homepage: http://www.brandonmartinez.com/
38
+ licenses: []
39
+
40
+ post_install_message:
41
+ rdoc_options:
42
+ - --charset=UTF-8
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ segments:
50
+ - 0
51
+ version: "0"
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ requirements: []
60
+
61
+ rubyforge_project:
62
+ rubygems_version: 1.3.6
63
+ signing_key:
64
+ specification_version: 3
65
+ summary: Recipes for Capistrano Deployments of WordPress
66
+ test_files: []
67
+