2017-04-24 183 views
0

我想部署在本地服务器上的导轨应用与capistrano。 但是,服务器无法向外部(互联网)ssh,所以我无法使用[email protected]:sample/repo.git作为部署文件中的repo url。相反,我使用https://[email protected]:sample/repo.git。但是当我运行cap production deploy时,我收到了无效的用户名或密码错误。 下面是我deploy.rb文件https部署与capistrano

lock "3.8.1" 

set :scm, :git 
set :application, "sample" 
set :scm_username, "user" 
set :scm_password, "password" 
set :repo_url, "https://[email protected]:sample/repo.git" 

set :branch, "production" 

set :deploy_to, "/home/deploy/sample" 

我一定能成功,使得帽问我密码(如果不使用scm_password

回答

1

更改:

set :scm_username, "user" 
set :scm_password, "password" 

set :git_http_username, "user" 
set :git_http_password, "password" 

另外,我想你可以只是把用户名/密码在URL中,例如:

set :repo_url, "https://user:[email protected]:sample/repo.git"