foundry_wordpress_tool 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
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, but boy oh boy is deployment & dealing with multiple environments a pain in the ass.
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. First, install the gem:
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 # 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 uploads_pull # Pull wp-content/uploads from the remote
39
- fwt uploads_push # Push wp-content/uploads to the remote host
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... ####
@@ -25,5 +25,6 @@ Gem::Specification.new do |s|
25
25
  s.add_runtime_dependency 'thor'
26
26
  s.add_runtime_dependency 'net-ssh', '~> 2.1.0'
27
27
  s.add_runtime_dependency 'net-ssh-gateway', '~> 1.1.0'
28
+ s.add_runtime_dependency 'capistrano', '~> 2.9.0'
28
29
 
29
30
  end
@@ -3,6 +3,8 @@ require 'thor'
3
3
  require 'yaml'
4
4
  require 'net/ssh'
5
5
  require 'net/ssh/gateway'
6
+ require 'capistrano'
7
+ require 'capistrano/cli'
6
8
 
7
9
  require 'foundry_wordpress_tool/base'
8
10
  require "foundry_wordpress_tool/version"
@@ -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
- rsync_command = "rsync -avz #{'--delete' if options.delete} #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/ wp-content/uploads/"
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
- rsync_command = "rsync -avz #{'--delete' if options.delete} wp-content/uploads/ #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/"
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
 
@@ -1,3 +1,3 @@
1
1
  module FoundryWordpressTool
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-02-23 00:00:00.000000000 Z
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: &70160317389300 !ruby/object:Gem::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: *70160317389300
24
+ version_requirements: *70299362561600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: net-ssh
27
- requirement: &70160317387940 !ruby/object:Gem::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: *70160317387940
35
+ version_requirements: *70299362559000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: net-ssh-gateway
38
- requirement: &70160317387420 !ruby/object:Gem::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: *70160317387420
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