我正在测试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"
我错过了什么?
非常感谢。