使用WP-Deploy暂存WordPress站点

时间:2014-06-03 作者:Alejandro Alcalde

我正在测试WP Deploy,但无法使其工作。我遵循文档中的步骤,但由于某种原因,在执行时

$ 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:  ***
    ========================================================================= 
然后:

$ bundle exec cap staging deploy
我得到:

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>
更新现在一切正常。我的配置如下。虚拟机中的本地环境、真实服务器中的开发环境和真实服务器中的生产环境。我需要在本地环境和远程服务器之间以及本地环境和Bitbucket上的git repo之间建立SSH连接。现在一切都很好,我有一个WordPress的暂存环境,Capistrano使用WP Deploy

我不知道为什么我在本地环境中需要SSH连接,我在本地环境中使用了虚拟机,没有任何内容复制到登台中指定的路径。rb型(/opt/lampp/htdocs/blog/) . 以下是我的配置文件:

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, "[email protected]: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"
我错过了什么?

非常感谢。

2 个回复
SO网友:jim.duck

首先,您需要在配置/部署中的“WordPress”标题下设置全局WP设置。rb:

set :wp_user, "aaronthomas" # The admin username
set :wp_email, "[email protected]" # The admin email address
set :wp_sitename, "WP Deploy" # The site title
set :wp_localurl, "localhost" # Your local environment URL
这些是用于WordPress初始安装的设置。您还需要在同一文件中定义git存储库:

set :application, "wp-deploy"
set :repo_url, "[email protected]:Mixd/wp-deploy.git"

Here is how to configure the rest of wp-deploy

SO网友:WPDEVE

不是答案,而是另一种选择。几个月来,我一直在使用一个名为Wordmove的Ruby宝石,它工作得很好。

仍然使用git进行版本控制,但直接从本地环境部署到生产环境或临时环境。

结束

相关推荐