wpcap 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -16
- data/lib/wpcap/recipes/base.rb +24 -5
- data/lib/wpcap/recipes/mysql.rb +7 -5
- data/lib/wpcap/recipes/templates/deploy.rb.erb +3 -0
- data/lib/wpcap/recipes/templates/deploy_stage.rb.erb +6 -0
- data/lib/wpcap/recipes/templates/nginx_php.erb +17 -9
- data/lib/wpcap/recipes/wordpress.rb +45 -46
- data/lib/wpcap/version.rb +1 -1
- metadata +147 -149
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# WPcap
|
2
2
|
|
3
|
-
WPcap is a set of capistrano recipes designed to deploy wordpress instaliations to ubuntu 12.04 and up. It provides database and asset sync tasks, per deploy mysql backups, a helper appication to setup a brand new wordpress install ready to be deployed.
|
3
|
+
WPcap is a set of capistrano recipes designed to deploy wordpress instaliations to ubuntu 12.04 and up. It provides database and asset sync tasks, per deploy mysql backups, a helper appication to setup a brand new wordpress install ready to be deployed.
|
4
4
|
|
5
|
-
WPcap is opinionated, and currently reasonably narrow minded.
|
5
|
+
WPcap is opinionated, and currently reasonably narrow minded.
|
6
6
|
|
7
7
|
WPcap expectations
|
8
8
|
|
9
9
|
* Local Macine is a Mac running MAMP (for now)
|
10
|
-
* Remote Server is a brand new Ubuntu Server
|
10
|
+
* Remote Server is a brand new Ubuntu Server
|
11
11
|
* Passwordless access to remote server has be established (ssh keys) **Capistrano Requirment**
|
12
12
|
* Using a SMTP Mailer Plugin for E-Mail delivery ie. wp-mail-smtp
|
13
13
|
|
@@ -18,7 +18,7 @@ WPcap server configuration
|
|
18
18
|
* mysql > 5.5
|
19
19
|
* memcached
|
20
20
|
* varnish (Optional)
|
21
|
-
|
21
|
+
|
22
22
|
* **Core**
|
23
23
|
* git
|
24
24
|
* debconf-utils
|
@@ -33,7 +33,7 @@ Install it:
|
|
33
33
|
## Usage
|
34
34
|
|
35
35
|
Create a new projet
|
36
|
-
|
36
|
+
|
37
37
|
wpcap create mynewproject
|
38
38
|
|
39
39
|
Convert an existing project to WPcap (Incomplete)
|
@@ -41,7 +41,7 @@ Convert an existing project to WPcap (Incomplete)
|
|
41
41
|
wpcap build PATH-TO-WORDPRESS-FOLDER
|
42
42
|
|
43
43
|
Build a remote server
|
44
|
-
|
44
|
+
|
45
45
|
cap deploy:install
|
46
46
|
|
47
47
|
Setup a remote server for this wordpress install
|
@@ -51,30 +51,29 @@ Setup a remote server for this wordpress install
|
|
51
51
|
Deploy your latest code to the server
|
52
52
|
|
53
53
|
cap deploy
|
54
|
-
|
55
|
-
Push Local Database and Assets to remote server
|
54
|
+
|
55
|
+
Push Local Database and Assets to remote server (will update aboslute URLS in wordpress post content)
|
56
56
|
|
57
57
|
cap db:push
|
58
|
-
|
59
|
-
Pull Remote Database and Assets to local enviroment
|
58
|
+
|
59
|
+
Pull Remote Database and Assets to local enviroment (will update aboslute URLS in wordpress post content)
|
60
60
|
|
61
61
|
cap db:pull
|
62
|
-
|
62
|
+
|
63
63
|
List Backups and Resotre
|
64
64
|
|
65
65
|
cap backups
|
66
|
-
|
66
|
+
|
67
67
|
## Todo
|
68
68
|
|
69
69
|
* Covert a predone wordpress install into a wpcap style directory
|
70
|
-
* Do not require MAMP
|
71
70
|
* Allow users to customize templates by placing them in their config directory (think devise generators for views)
|
72
71
|
* Automate mysql_secure_installation
|
73
|
-
* Offsite (s3) Backups
|
72
|
+
* Offsite (s3) Backups
|
74
73
|
* Backup Asset Directory
|
75
74
|
* Add Sendmail Receipe and Config (Maybe?)
|
76
|
-
|
77
|
-
|
75
|
+
|
76
|
+
|
78
77
|
|
79
78
|
## Contributing
|
80
79
|
|
data/lib/wpcap/recipes/base.rb
CHANGED
@@ -21,11 +21,20 @@ configuration.load do
|
|
21
21
|
chars = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0)
|
22
22
|
(1..size).collect{|a| chars[rand(chars.size)] }.join
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def remote_file_exists?(full_path)
|
26
26
|
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
|
+
def set_local_uri
|
30
|
+
httpd_conf = File.read(local_httpd_conf_path)
|
31
|
+
document_root = httpd_conf.match(/^(?!#)DocumentRoot "(.+)"\n/)[1]
|
32
|
+
apache_listen = httpd_conf.match(/^(?!#)Listen ([0-9]{1,16})\n/)[1]
|
33
|
+
current_path = Dir.pwd
|
34
|
+
set(:local_uri , "http://localhost:#{apache_listen}#{Dir.pwd.gsub(document_root, '')}/app")
|
35
|
+
end
|
36
|
+
|
37
|
+
|
29
38
|
def run_with_tty(server, cmd)
|
30
39
|
# looks like total pizdets
|
31
40
|
command = []
|
@@ -43,7 +52,17 @@ configuration.load do
|
|
43
52
|
default_run_options[:pty] = true
|
44
53
|
ssh_options[:forward_agent] = true
|
45
54
|
set :use_sudo , false
|
46
|
-
|
55
|
+
set :newrelic , true
|
56
|
+
|
57
|
+
if mamp
|
58
|
+
set_default :local_mysql_path , "/Applications/MAMP/Library/bin/"
|
59
|
+
set_default :local_httpd_conf_path , "/Applications/MAMP/conf/apache/httpd.conf"
|
60
|
+
else
|
61
|
+
set_default :local_mysql_path , ""
|
62
|
+
set_default :local_httpd_conf_path , "/etc/apache2/httpd.conf"
|
63
|
+
end
|
64
|
+
set_local_uri
|
65
|
+
|
47
66
|
namespace :deploy do
|
48
67
|
desc "Install everything onto the server"
|
49
68
|
task :install do
|
@@ -51,7 +70,7 @@ configuration.load do
|
|
51
70
|
run "#{sudo} apt-get -y install git debconf-utils python-software-properties"
|
52
71
|
end
|
53
72
|
end
|
54
|
-
|
73
|
+
|
55
74
|
desc "Tail all or a single remote file"
|
56
75
|
task :tail do
|
57
76
|
ENV["LOGFILE"] ||= "*.log"
|
@@ -60,4 +79,4 @@ configuration.load do
|
|
60
79
|
break if stream == :err
|
61
80
|
end
|
62
81
|
end
|
63
|
-
end
|
82
|
+
end
|
data/lib/wpcap/recipes/mysql.rb
CHANGED
@@ -175,10 +175,12 @@ configuration.load do
|
|
175
175
|
|
176
176
|
def fetch_db_config(remote = false)
|
177
177
|
if remote
|
178
|
-
|
178
|
+
config = YAML.load( capture("cat /etc/wpcap/database.yml") )
|
179
179
|
else
|
180
|
-
|
180
|
+
config = YAML.load(File.open("config/database.yml"))
|
181
181
|
end
|
182
|
+
|
183
|
+
config || {}
|
182
184
|
end
|
183
185
|
|
184
186
|
# Sets database variables from remote database.yaml
|
@@ -187,12 +189,12 @@ configuration.load do
|
|
187
189
|
load_stage = load_stage.to_s
|
188
190
|
|
189
191
|
if !db_config
|
190
|
-
Wpcap::Utility.error("No Database
|
192
|
+
Wpcap::Utility.error("No Database Configurations Found")
|
191
193
|
abort
|
192
194
|
end
|
193
195
|
|
194
196
|
if remote_config(:db_priv_pass).nil?
|
195
|
-
Wpcap::Utility.error "This no
|
197
|
+
Wpcap::Utility.error "This no privileged user for this server found in servers ssh environment profile (did you set it up with wpcap?)"
|
196
198
|
abort
|
197
199
|
end
|
198
200
|
|
@@ -216,7 +218,7 @@ configuration.load do
|
|
216
218
|
set :db_username , "#{application.split(".").first}_#{stage}"
|
217
219
|
set :db_database , "#{application.split(".").first}_#{stage}"
|
218
220
|
set :db_password , random_password(16)
|
219
|
-
set :db_prefix , db_config["development"]["prefix"]
|
221
|
+
set :db_prefix , "wp_" || db_config["development"]["prefix"]
|
220
222
|
|
221
223
|
run "mkdir -p #{shared_path}/config"
|
222
224
|
template "mysql.yml.erb", "#{shared_path}/config/database.yml"
|
@@ -25,6 +25,9 @@ set :uploads_path, "assets"
|
|
25
25
|
#Are you using MAMP on your local machine?
|
26
26
|
set :mamp , true
|
27
27
|
|
28
|
+
#Are you using intense nginx rewrites or WP3 Total Cache?
|
29
|
+
set :custom_nginx , false
|
30
|
+
|
28
31
|
# if you want to clean up old releases on each deploy uncomment this:
|
29
32
|
set :keep_releases, 5
|
30
33
|
after "deploy", "deploy:cleanup"
|
@@ -8,3 +8,9 @@ set :user, "root"
|
|
8
8
|
set :application_url, "your full url here including the protocol (https/http)"
|
9
9
|
server "your server address or url here", :web, :app, :db, primary: true
|
10
10
|
|
11
|
+
# Database Backup Path
|
12
|
+
set :backups_path, "#{deploy_to}/backups"
|
13
|
+
set :keep_backups, 5
|
14
|
+
|
15
|
+
# if you want to clean up old backups on each deploy uncomment this:
|
16
|
+
# after :deploy , 'backups:cleanup'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
server {
|
2
2
|
listen 80;
|
3
|
-
server_name <%= application
|
3
|
+
server_name <%= application %> <%= application_url.gsub(/^https?:\/\//, "") %> www.<%= application %> www.<%= application_url.gsub(/^https?:\/\//, "") %> ;
|
4
4
|
root <%= current_path %>/app;
|
5
5
|
index index.php;
|
6
6
|
|
@@ -15,43 +15,51 @@ server {
|
|
15
15
|
rewrite ^/assets/js/(.*)$ /wp-content/themes/<%= wp_template %>/assets/js/$1 last;
|
16
16
|
rewrite ^/assets/img/(.*)$ /wp-content/themes/<%= wp_template %>/assets/img/$1 last;
|
17
17
|
}
|
18
|
-
|
18
|
+
|
19
19
|
location ^~ /plugins/ {
|
20
20
|
rewrite ^/plugins/(.*)$ /wp-content/plugins/$1 last;
|
21
21
|
}
|
22
|
-
|
22
|
+
|
23
23
|
location = /favicon.ico {
|
24
24
|
log_not_found off;
|
25
25
|
access_log off;
|
26
26
|
}
|
27
|
-
|
27
|
+
|
28
28
|
location = /robots.txt {
|
29
29
|
allow all;
|
30
30
|
log_not_found off;
|
31
31
|
access_log off;
|
32
32
|
}
|
33
|
-
|
33
|
+
|
34
34
|
location / {
|
35
35
|
try_files $uri $uri/ /index.php?$args;
|
36
36
|
}
|
37
|
-
|
37
|
+
|
38
38
|
location ~ \.php$ {
|
39
39
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
40
40
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
41
41
|
fastcgi_index index.php;
|
42
42
|
include fastcgi_params;
|
43
|
+
<% if newrelic %>
|
44
|
+
if (extension_loaded ('newrelic')) {
|
45
|
+
newrelic_set_appname ("<% application %>;All Virtual Hosts");
|
46
|
+
}
|
47
|
+
<% end%>
|
43
48
|
}
|
44
|
-
|
49
|
+
|
45
50
|
if (-f $document_root/system/maintenance.html) {
|
46
51
|
return 503;
|
47
52
|
}
|
48
|
-
|
53
|
+
|
49
54
|
error_page 503 @maintenance;
|
50
55
|
location @maintenance {
|
51
56
|
rewrite ^(.*)$ /system/maintenance.html last;
|
52
57
|
break;
|
53
58
|
}
|
54
|
-
|
59
|
+
|
60
|
+
<% if custom_nginx %>
|
55
61
|
include <%= shared_path %>/config/nginx.conf;
|
62
|
+
<% end %>
|
63
|
+
|
56
64
|
|
57
65
|
}
|
@@ -7,24 +7,18 @@ Capistrano.configuration(:must_exist)
|
|
7
7
|
|
8
8
|
configuration.load do
|
9
9
|
extraction_terms = [ {"DB_CHARSET" => "encoding"}, {"DB_NAME" => "database"} , {"DB_USER" => "username"} , {"DB_PASSWORD" => "password" } , {"DB_HOST" => "host"}]
|
10
|
-
|
10
|
+
|
11
11
|
set_default :uploads_path, "wp-content/uploads"
|
12
12
|
|
13
|
-
if mamp
|
14
|
-
set_default :local_mysql_path , "/Applications/MAMP/Library/bin/"
|
15
|
-
set_default :local_httpd_conf_path , "/Applications/MAMP/conf/apache/httpd.conf"
|
16
|
-
else
|
17
|
-
set_default :local_mysql_path , ""
|
18
|
-
set_default :local_httpd_conf_path , "/etc/apache2/httpd.conf"
|
19
|
-
end
|
20
13
|
|
21
14
|
|
22
|
-
|
15
|
+
|
16
|
+
namespace :db do
|
23
17
|
desc "Alias for db:mysql:pull"
|
24
18
|
task :pull , :roles => :db do
|
25
19
|
db.mysql.pull
|
26
20
|
end
|
27
|
-
|
21
|
+
|
28
22
|
desc "Alias for db:mysql:push"
|
29
23
|
task :push , :roles => :db do
|
30
24
|
db.mysql.push
|
@@ -38,44 +32,41 @@ configuration.load do
|
|
38
32
|
|
39
33
|
run "rm -Rf #{shared_path}/pids"
|
40
34
|
run "rm -Rf #{shared_path}/system"
|
41
|
-
|
35
|
+
|
42
36
|
# create shared directories
|
43
37
|
run "mkdir -p #{shared_path}/uploads"
|
44
38
|
run "mkdir -p #{shared_path}/cache"
|
45
39
|
run "mkdir -p #{shared_path}/logs"
|
46
40
|
run "mkdir -p #{shared_path}/config"
|
47
41
|
run "mkdir -p #{backups_path}"
|
48
|
-
|
42
|
+
|
49
43
|
# setup for wp total cache
|
50
|
-
run "touch #{shared_path}/config/nginx.conf"
|
51
|
-
|
44
|
+
run "touch #{shared_path}/config/nginx.conf" if custom_nginx
|
45
|
+
|
52
46
|
# set correct permissions
|
53
47
|
run "chmod -R 755 #{latest_release}/app/wp-content/plugins"
|
54
48
|
run "chmod -R 775 #{shared_path}/uploads"
|
55
49
|
run "chmod -R 775 #{shared_path}/cache"
|
56
50
|
run "chmod -R 755 #{latest_release}"
|
57
|
-
run "chown -R -h #{user}:www-data #{latest_release}"
|
58
|
-
run "chown -R -h #{user}:www-data #{shared_path}"
|
59
51
|
end
|
60
|
-
|
52
|
+
|
61
53
|
desc "[internal] Touches up the released code. This is called by update_code after the basic deploy finishes."
|
62
54
|
task :finalize_update, :roles => :web, :except => { :no_release => true } do
|
63
55
|
# remove shared directories
|
64
56
|
run "rm -Rf #{latest_release}/app/#{uploads_path}"
|
65
57
|
run "rm -Rf #{latest_release}/wp-content/cache"
|
66
|
-
run "rm -Rf #{latest_release}/nginx.conf"
|
67
58
|
|
68
59
|
# Removing cruft files.
|
69
60
|
run "rm -Rf #{latest_release}/license.txt"
|
70
61
|
run "rm -Rf #{latest_release}/readme.html"
|
71
|
-
|
62
|
+
|
72
63
|
end
|
73
64
|
desc "[internal] Verify Code and repo is ready to be released"
|
74
65
|
task :check_code, :except => { :no_release => true } do
|
75
66
|
#make sure the user has actually set up the wordpress install
|
76
67
|
unless File.exists?("app/wp-config.php")
|
77
68
|
Wpcap::Utility.error("This Wordpress Installation does not appear to have a wp-config.php file (Please create one at app/wp-config.php )")
|
78
|
-
abort
|
69
|
+
abort
|
79
70
|
end
|
80
71
|
end
|
81
72
|
before "deploy", "deploy:check_code"
|
@@ -83,13 +74,17 @@ configuration.load do
|
|
83
74
|
end
|
84
75
|
|
85
76
|
namespace :wordpress do
|
86
|
-
|
77
|
+
|
87
78
|
desc "Links the correct settings file"
|
88
79
|
task :symlink, :roles => :web, :except => { :no_release => true } do
|
89
80
|
run "ln -nfs #{shared_path}/uploads #{latest_release}/app/#{uploads_path}"
|
90
81
|
run "ln -nfs #{shared_path}/cache #{latest_release}/app/wp-content/cache"
|
91
|
-
|
92
|
-
|
82
|
+
|
83
|
+
if custom_nginx
|
84
|
+
run "rm -f #{shared_path}/config/nginx.conf"
|
85
|
+
run "ln -nfs #{shared_path}/config/nginx.conf #{latest_release}/app/nginx.conf"
|
86
|
+
end
|
87
|
+
|
93
88
|
end
|
94
89
|
|
95
90
|
desc "Generate a wp-config.php based upon the app server geneated db password"
|
@@ -98,83 +93,87 @@ configuration.load do
|
|
98
93
|
wpconfig = run_locally "cat app/wp-config.php"
|
99
94
|
stage_config = "/tmp/wp-config.#{stage}"
|
100
95
|
db.mysql.prepare_env
|
101
|
-
|
96
|
+
|
102
97
|
extraction_terms.each do |env|
|
103
98
|
term = env.keys.first
|
104
99
|
sym = env.values.first
|
105
100
|
wpconfig = wpconfig.gsub(/define\('#{term}', '.{1,16}'\);/, "define\('#{term}', '#{send("db_"+sym)}');")
|
106
101
|
end
|
107
|
-
|
102
|
+
|
108
103
|
wpconfig = wpconfig.gsub(/\$table_prefix = '.{1,16}';/, "$table_prefix = '#{send("db_prefix")}';")
|
109
104
|
File.open(stage_config, 'w') {|f| f.write(wpconfig) }
|
110
105
|
upload stage_config, "#{latest_release}/app/wp-config.php"
|
111
106
|
run_locally "rm #{stage_config}"
|
112
107
|
end
|
113
|
-
|
108
|
+
|
114
109
|
desc "Sync Local Assets to Remote"
|
115
|
-
task "assets_push", :roles => :web do
|
110
|
+
task "assets_push", :roles => :web do
|
116
111
|
servers = find_servers_for_task(current_task)
|
117
112
|
servers.each do |server|
|
118
113
|
run_locally "if [ -d app/#{uploads_path} ]; then rsync -avhru app/#{uploads_path}/* -delete -e 'ssh -p #{port}' #{user}@#{server}:#{shared_path}/uploads; fi"
|
119
114
|
end
|
120
115
|
end
|
121
|
-
|
116
|
+
|
122
117
|
desc "Sync Remote Assets to Local"
|
123
|
-
task "assets_pull", :roles => :web do
|
118
|
+
task "assets_pull", :roles => :web do
|
124
119
|
servers = find_servers_for_task(current_task)
|
125
120
|
servers.each do |server|
|
126
121
|
run_locally "if [ -d app/#{uploads_path} ]; then rsync -avhru -delete -e 'ssh -p #{port}' #{user}@#{server}:#{shared_path}/uploads/* app/#{uploads_path}; fi"
|
127
122
|
end
|
128
123
|
end
|
129
|
-
|
124
|
+
|
130
125
|
desc "Extract PHP DB Env Vars"
|
131
126
|
task :extract_local_db, :except => { :no_release => true } do
|
132
127
|
wpconfig = run_locally "cat app/wp-config.php"
|
133
128
|
dev_env = {"development" => {}}
|
134
129
|
extraction_terms.each do |env|
|
135
|
-
db.mysql.prepare_env
|
136
130
|
term = env.keys.first
|
137
131
|
sym = env.values.first
|
138
132
|
dev_env["development"][sym] = wpconfig.match(/define\('#{term}', '(.{1,16})'\);/)[1]
|
139
133
|
end
|
140
|
-
|
134
|
+
|
141
135
|
dev_env["development"]["prefix"] = wpconfig.match(/\$table_prefix = '(.{1,16})';/)[1]
|
142
136
|
db.mysql.update_db_config(dev_env)
|
143
137
|
print dev_env
|
144
138
|
end
|
145
139
|
before "deploy:setup", "wordpress:extract_local_db"
|
146
|
-
|
140
|
+
|
147
141
|
desc "Set URL in database"
|
148
142
|
task :updatedb, :roles => :db, :except => { :no_release => true } do
|
149
143
|
db.mysql.prepare_env
|
144
|
+
|
150
145
|
run "mysql -u #{db_username} -p #{db_database} -e 'UPDATE #{db_prefix}options SET option_value = \"#{application_url}\" WHERE option_name = \"siteurl\" OR option_name = \"home\"'" do |ch, stream, out|
|
151
146
|
ch.send_data "#{db_password}\n" if out =~ /^Enter password:/
|
152
147
|
puts out
|
153
|
-
end
|
148
|
+
end
|
149
|
+
|
150
|
+
run "mysql -u #{db_username} -p #{db_database} -e 'UPDATE #{db_prefix}posts SET post_content = REPLACE(post_content, \"#{local_uri}\", \"#{application_url}\")'" do |ch, stream, out|
|
151
|
+
ch.send_data "#{db_password}\n" if out =~ /^Enter password:/
|
152
|
+
puts out
|
153
|
+
end
|
154
154
|
end
|
155
155
|
after "db:mysql:push", "wordpress:updatedb"
|
156
156
|
after "db:mysql:push", "wordpress:assets_push"
|
157
|
-
|
157
|
+
|
158
158
|
desc "Set URL in local database"
|
159
159
|
task :update_local_db, :except => { :no_release => true } do
|
160
160
|
db.mysql.prepare_env(:development)
|
161
|
-
|
162
|
-
document_root = httpd_conf.match(/^(?!#)DocumentRoot "(.+)"\n/)[1]
|
163
|
-
apache_listen = httpd_conf.match(/^(?!#)Listen ([0-9]{1,16})\n/)[1]
|
164
|
-
current_path = Dir.pwd
|
165
|
-
local_uri = "http://localhost:#{apache_listen}#{Dir.pwd.gsub(document_root, '')}/app"
|
161
|
+
|
166
162
|
run_locally "#{local_mysql_path}mysql -u #{db_username} -p#{db_password} #{db_database} -e 'UPDATE #{db_prefix}options SET option_value = \"#{local_uri}\" WHERE option_name = \"siteurl\" OR option_name = \"home\"'"
|
163
|
+
#Update Absolute URLs for wordpress content (if content is editied locally it will not push correctly to other stages)
|
164
|
+
run_locally "#{local_mysql_path}mysql -u #{db_username} -p#{db_password} #{db_database} -e 'UPDATE #{db_prefix}posts SET post_content = REPLACE(post_content, \"#{application_url}\", \"#{local_uri}\")'"
|
167
165
|
end
|
166
|
+
|
168
167
|
after "db:mysql:pull", "wordpress:update_local_db"
|
169
168
|
after "db:mysql:pull", "wordpress:assets_pull"
|
170
|
-
|
169
|
+
|
171
170
|
desc "[internal] Protect system files"
|
172
171
|
task :protect, :except => { :no_release => true } do
|
173
172
|
run "chmod 444 #{latest_release}/app/wp-config.php*"
|
174
|
-
|
175
|
-
|
173
|
+
run "cd #{current_path} && chown -R #{user} . && find . -type d -print0 | xargs -0 chmod 755"
|
174
|
+
run "cd #{shared_path}/uploads && chown -R #{user} . && chmod 755 -R ."
|
176
175
|
end
|
177
|
-
|
176
|
+
|
178
177
|
desc "[internal] get current wp template from local db"
|
179
178
|
task :current_wp_template, :except => { :no_release => true } do
|
180
179
|
db.mysql.prepare_env(:development)
|
@@ -186,9 +185,9 @@ configuration.load do
|
|
186
185
|
end
|
187
186
|
end
|
188
187
|
before "nginx:setup", "wordpress:current_wp_template"
|
189
|
-
|
188
|
+
|
190
189
|
after "wordpress:symlink", "wordpress:create_config"
|
191
190
|
after "wordpress:create_config", "wordpress:protect"
|
192
191
|
after "deploy", "wordpress:symlink"
|
193
192
|
end
|
194
|
-
end
|
193
|
+
end
|
data/lib/wpcap/version.rb
CHANGED
metadata
CHANGED
@@ -1,168 +1,158 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: wpcap
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Russell Osborne
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-06-01 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: capistrano
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
38
32
|
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: railsless-deploy
|
39
36
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
54
46
|
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: thor
|
55
50
|
prerelease: false
|
56
|
-
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
63
|
name: guard
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
64
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
86
74
|
type: :development
|
75
|
+
version_requirements: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: guard-rspec
|
87
78
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
102
88
|
type: :development
|
89
|
+
version_requirements: *id005
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: webmock
|
103
92
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
118
102
|
type: :development
|
103
|
+
version_requirements: *id006
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: rb-fsevent
|
119
106
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ! '>='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
107
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
134
116
|
type: :development
|
117
|
+
version_requirements: *id007
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: rspec
|
135
120
|
prerelease: false
|
136
|
-
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
none: false
|
146
|
-
requirements:
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
121
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
150
130
|
type: :development
|
131
|
+
version_requirements: *id008
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: fakefs
|
151
134
|
prerelease: false
|
152
|
-
|
153
|
-
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
135
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
143
|
+
version: "0"
|
144
|
+
type: :development
|
145
|
+
version_requirements: *id009
|
158
146
|
description: A Tool to Setup, Maintain, and Deploy Capistrano Driven Wordpress Sites
|
159
|
-
email:
|
147
|
+
email:
|
160
148
|
- russell@burningpony.com
|
161
|
-
executables:
|
149
|
+
executables:
|
162
150
|
- wpcap
|
163
151
|
extensions: []
|
152
|
+
|
164
153
|
extra_rdoc_files: []
|
165
|
-
|
154
|
+
|
155
|
+
files:
|
166
156
|
- .gitignore
|
167
157
|
- .rspec
|
168
158
|
- Gemfile
|
@@ -201,30 +191,38 @@ files:
|
|
201
191
|
- wpcap.gemspec
|
202
192
|
homepage: https://github.com/rposborne/wpcap
|
203
193
|
licenses: []
|
194
|
+
|
204
195
|
post_install_message:
|
205
196
|
rdoc_options: []
|
206
|
-
|
197
|
+
|
198
|
+
require_paths:
|
207
199
|
- lib
|
208
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
209
201
|
none: false
|
210
|
-
requirements:
|
211
|
-
- -
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
|
214
|
-
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
hash: 3
|
206
|
+
segments:
|
207
|
+
- 0
|
208
|
+
version: "0"
|
209
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
210
|
none: false
|
216
|
-
requirements:
|
217
|
-
- -
|
218
|
-
- !ruby/object:Gem::Version
|
219
|
-
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
hash: 3
|
215
|
+
segments:
|
216
|
+
- 0
|
217
|
+
version: "0"
|
220
218
|
requirements: []
|
219
|
+
|
221
220
|
rubyforge_project:
|
222
221
|
rubygems_version: 1.8.24
|
223
222
|
signing_key:
|
224
223
|
specification_version: 3
|
225
|
-
summary: A Tool to Setup, Maintain, and Deploy Capistrano Driven Wordpress Sites on
|
226
|
-
|
227
|
-
test_files:
|
224
|
+
summary: A Tool to Setup, Maintain, and Deploy Capistrano Driven Wordpress Sites on any cloud server or linux macine
|
225
|
+
test_files:
|
228
226
|
- spec/binary/wpcap_spec.rb
|
229
227
|
- spec/spec_helper.rb
|
230
228
|
- spec/test_payloads/existing/wp-config.php
|