3

I am testing WP-Deploy, but can't get it work. I follow the steps in the docs but for some reason when I execute

$ bundle exec cap staging wp:setup:local
 INFO [b4d7f211] Running /usr/bin/env wp core install --url='http://localhost/blog' --title='TITLE' --admin_user='YYYY' --admin_password='YYYY' --admin_email='YYYY' on 
 INFO [b4d7f211] Finished in 0.054 seconds with exit status 0 (successful).

    =========================================================================
      WordPress has successfully been installed. Here are your login details:

      Username:       ***
      Password:       ***
      Email address:  ***
    ========================================================================= 

And then:

$ bundle exec cap staging deploy

I get:

INFO [2482ebbf] Running /usr/bin/env mkdir -p /tmp/elbauldelprogramador/ on localhost
cap aborted!
Connection refused - connect(2) for "localhost" port 22

Tasks: TOP => git:check => git:wrapper
(See full trace by running task with --trace)
The deploy has failed with an error: #<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 22>

UPDATE

Now all is working perfectly. My configuration is the following. A local environment within a Virtual Machine, a development environment in the real server and a production environment in the real server. I needed a SSH connection between my local environment and the remote server, and between my local environment and my git repo at Bitbucket. Right now is all working great and I have a staging environment for WordPress with Capistrano using WP-Deploy

I do not know why I need a SSH connection on my local environment, I've using a virtual machine for the local environment and nothing is copied to the path specified in staging.rb (/opt/lampp/htdocs/blog/) . Here are my config files:

Deploy.rb

############################################
# Setup WordPress
############################################

set :wp_user, "algui91" # The admin username
set :wp_email, "****" # The admin email address
set :wp_sitename, "El Baúl del Programador" # The site title
set :wp_localurl, "http://localhost/blog" # Your local environment URL

############################################
# Setup project
############################################

set :application, "elbauldelprogramador"
set :repo_url, "git@bitbucket.org:algui91/elbauldelprogramador.git"
set :scm, :git

Production.rb

############################################
# Setup Server
############################################

set :stage, :production
set :stage_url, "http://elbauldelprogramador.com"
server "ip", user: "user", roles: %w{web app db}
set :deploy_to, "path"

############################################
# Setup Git
############################################

set :branch, "master"

Staging.rb

############################################
# Setup Server
############################################

set :stage, :staging
set :stage_url, "http://localhost/blog"
server "127.0.0.1", user: "hkr", roles: %w{web app db}
set :deploy_to, "/opt/lampp/htdocs/blog/"

############################################
# Setup Git
############################################

set :branch, "development"

What am I missing?

Thank you

  • 1
    The first part of your question, regarding the comparison of the methods likely doesn't fit the quality guidelines for questions on WordPress Development and will only lead to opinionated answers I think. You might want to read How to Ask. Additionally a question should concern a singular problem. So it is better to ask a new question, instead of putting everything into one. – Nicolai Jun 3 '14 at 14:39
  • Sorry I thought this type of question was allowed, like in stackoverflow, in What to ask: software tools commonly used by programmers – ElBaulP Jun 3 '14 at 14:48
  • Not a problem. I actually don't know a lot about the differences between the the guidelines of the different stacks out there, but I'm certain that here those kind of questions are considered problematic. Besides that, what do the docs of WP-Deploy say about not using SSH? Or, why don't you configure your local setup to accept SSH connections? – Nicolai Jun 3 '14 at 14:56
  • I originally ask this question in SO, but I thought here I could get more help. I am finding the docs of WP-Deploy (github.com/Mixd/wp-deploy) very limited. I will try, but I think is a bit silly connect through ssh to access the same machine. – ElBaulP Jun 3 '14 at 15:03
  • I don't know WP-Deploy well enough, but it just seems like a matter of the right configuration. Good luck! – Nicolai Jun 3 '14 at 15:11
1

First off, you need to set your global WP settings under the "WordPress" heading in config/deploy.rb:

set :wp_user, "aaronthomas" # The admin username
set :wp_email, "aaron@example.com" # The admin email address
set :wp_sitename, "WP Deploy" # The site title
set :wp_localurl, "localhost" # Your local environment URL

These are the settings used for your inital installation of WordPress. You also need to define your git repository in the same file:

set :application, "wp-deploy"
set :repo_url, "git@github.com:Mixd/wp-deploy.git"

Here is how to configure the rest of wp-deploy

  • Please properly format your post. – Pieter Goosen Aug 27 '15 at 12:35
1

Not an answer but an alternative. I have been using a Ruby Gem called Wordmove for a few months and it's been working great.

Still use git for version control but deploy straight from your local environment to either production or staging.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.