foundry_wordpress_tool 0.0.4 → 0.0.5
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.md +10 -9
- data/foundry_wordpress_tool.gemspec +1 -0
- data/lib/foundry_wordpress_tool.rb +2 -0
- data/lib/foundry_wordpress_tool/base.rb +2 -0
- data/lib/foundry_wordpress_tool/git.rb +30 -0
- data/lib/foundry_wordpress_tool/uploads.rb +4 -2
- data/lib/foundry_wordpress_tool/version.rb +1 -1
- metadata +20 -8
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
## The problem ##
|
4
4
|
|
5
|
-
Wordpress is a fast tool for building a certain kind of website,
|
5
|
+
Wordpress is a fast tool for building a certain kind of website, deployment is largely a pain in the ass. We deal with dozens of clients who often have multiple environments. These environments span different distributions, shared hosting, dedicated VMs.
|
6
6
|
|
7
7
|
## The (beginning of a) solution ##
|
8
8
|
|
9
|
-
Introducing Foundry Wordpress Tool: standardizing deployments of Wordpress over a variety of hosts & environments.
|
9
|
+
Introducing Foundry Wordpress Tool: standardizing deployments of Wordpress over a variety of hosts & environments. To get started, install the gem:
|
10
10
|
|
11
11
|
```
|
12
12
|
$ gem install 'fwt'
|
@@ -29,14 +29,15 @@ Finally, you should be able to run `fwt` to get a list of available tasks & usag
|
|
29
29
|
|
30
30
|
```
|
31
31
|
$ fwt
|
32
|
-
** Welcome to Foundry Wordpress Tool! **
|
32
|
+
** Welcome to Foundry Wordpress Tool v0.0.5! **
|
33
33
|
|
34
34
|
Tasks:
|
35
|
-
fwt db_pull
|
36
|
-
fwt db_push
|
37
|
-
fwt help [TASK]
|
38
|
-
fwt
|
39
|
-
fwt
|
35
|
+
fwt db_pull # Dump the remote database & import it locally
|
36
|
+
fwt db_push # Dump the local database & import it remotely
|
37
|
+
fwt help [TASK] # Describe available tasks or one specific task
|
38
|
+
fwt remote_git_pull # Pull latest code on the remote server via git
|
39
|
+
fwt uploads_pull # Pull wp-content/uploads from the remote
|
40
|
+
fwt uploads_push # Push wp-content/uploads to the remote host
|
40
41
|
|
41
42
|
Options:
|
42
43
|
-e, [--env=ENV] # Name of the remote environment (as found in .fwt.yml).
|
@@ -48,7 +49,7 @@ We made a few assumptions to keep this tool simple:
|
|
48
49
|
|
49
50
|
#### The Wordpress server... ####
|
50
51
|
|
51
|
-
* You can SSH to it without specifying a password or an identity file.
|
52
|
+
* You can SSH to it without specifying a password or an identity file. Use your `.ssh/config`.
|
52
53
|
* Has a MySQL server running and accessible as the deploy user.
|
53
54
|
|
54
55
|
#### The development machine... ####
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'foundry_wordpress_tool/uploads'
|
2
2
|
require 'foundry_wordpress_tool/database'
|
3
|
+
require 'foundry_wordpress_tool/git'
|
3
4
|
|
4
5
|
module FoundryWordpressTool
|
5
6
|
class Base < ::Thor
|
6
7
|
include Thor::Actions
|
7
8
|
include FoundryWordpressTool::Uploads
|
8
9
|
include FoundryWordpressTool::Database
|
10
|
+
include FoundryWordpressTool::Git
|
9
11
|
|
10
12
|
class_option :env,
|
11
13
|
:desc => 'Name of the remote environment (as found in .fwt.yml).',
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module FoundryWordpressTool
|
2
|
+
module Git
|
3
|
+
def self.included(thor)
|
4
|
+
thor.class_eval do
|
5
|
+
|
6
|
+
desc "remote_git_pull", "Pull latest code on the remote server via git"
|
7
|
+
def remote_git_pull
|
8
|
+
load_environment_config()
|
9
|
+
cap_run("cd #{@config['deploy_to']} && git pull").run_command
|
10
|
+
end
|
11
|
+
|
12
|
+
no_tasks do
|
13
|
+
|
14
|
+
def cap_run(command)
|
15
|
+
cap = Capistrano::Configuration.new
|
16
|
+
cap.logger.level = Capistrano::Logger::TRACE
|
17
|
+
cap.set :user, @config['username']
|
18
|
+
cap.role :app, @config['host']
|
19
|
+
cap.task :run_command do
|
20
|
+
run command
|
21
|
+
end
|
22
|
+
cap
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -10,7 +10,8 @@ module FoundryWordpressTool
|
|
10
10
|
desc "uploads_pull", "Pull wp-content/uploads from the remote"
|
11
11
|
def uploads_pull
|
12
12
|
load_environment_config()
|
13
|
-
|
13
|
+
# #{'--delete' if options.delete}
|
14
|
+
rsync_command = "rsync -avz #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/ wp-content/uploads/"
|
14
15
|
run(rsync_command)
|
15
16
|
end
|
16
17
|
|
@@ -21,7 +22,8 @@ module FoundryWordpressTool
|
|
21
22
|
desc "uploads_push", "Push wp-content/uploads to the remote host"
|
22
23
|
def uploads_push
|
23
24
|
load_environment_config()
|
24
|
-
|
25
|
+
# #{'--delete' if options.delete}
|
26
|
+
rsync_command = "rsync -avz wp-content/uploads/ #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/"
|
25
27
|
run(rsync_command)
|
26
28
|
end
|
27
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foundry_wordpress_tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70299362561600 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70299362561600
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: net-ssh
|
27
|
-
requirement: &
|
27
|
+
requirement: &70299362559000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.1.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70299362559000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: net-ssh-gateway
|
38
|
-
requirement: &
|
38
|
+
requirement: &70299362574040 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,18 @@ dependencies:
|
|
43
43
|
version: 1.1.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70299362574040
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: capistrano
|
49
|
+
requirement: &70299362573000 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.9.0
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70299362573000
|
47
58
|
description: Helps manage Wordpress environments
|
48
59
|
email:
|
49
60
|
- jon@foundryinteractive.com
|
@@ -62,6 +73,7 @@ files:
|
|
62
73
|
- lib/foundry_wordpress_tool.rb
|
63
74
|
- lib/foundry_wordpress_tool/base.rb
|
64
75
|
- lib/foundry_wordpress_tool/database.rb
|
76
|
+
- lib/foundry_wordpress_tool/git.rb
|
65
77
|
- lib/foundry_wordpress_tool/uploads.rb
|
66
78
|
- lib/foundry_wordpress_tool/version.rb
|
67
79
|
homepage: http://github.com/foundryinteractive/foundry_wordpress_tool
|