2015-11-09 55 views
0

我试图让我的头绕着卡皮斯特拉诺。Capistrano中的部署用户是什么?

什么是ssh部署用户?我使用ssh访问共享主机空间,我通常使用ssh [email protected]并使用私有RSA密钥进行身份验证。

这是我在尝试做了部署输出

** Invoke production (first_time) 
** Execute production 
** Invoke load:defaults (first_time) 
** Execute load:defaults 
** Invoke deploy (first_time) 
** Execute deploy 
** Invoke deploy:starting (first_time) 
** Execute deploy:starting 
** Invoke deploy:check (first_time) 
** Execute deploy:check 
** Invoke git:check (first_time) 
** Invoke git:wrapper (first_time) 
** Execute git:wrapper 
INFO [ee6098c8] Running /usr/bin/env mkdir -p /tmp/tempdirname/ as [email protected] 
DEBUG [ee6098c8] Command: /usr/bin/env mkdir -p /tmp/tempdirname/ 
DEBUG [ee6098c8] stdin: is not a tty 
INFO [ee6098c8] Finished in 0.942 seconds with exit status 0 (successful). 
DEBUG Uploading /tmp/tempdirname/git-ssh.sh 0.0% 
INFO Uploading /tmp/tempdirname/git-ssh.sh 100.0% 
INFO [f4f1f009] Running /usr/bin/env chmod +x /tmp/tempdirname/git-ssh.sh as [email protected] 
DEBUG [f4f1f009] Command: /usr/bin/env chmod +x /tmp/tempdirname/git-ssh.sh 
DEBUG [f4f1f009] stdin: is not a tty 
INFO [f4f1f009] Finished in 0.164 seconds with exit status 0 (successful). 
** Execute git:check 
INFO [3788f5f2] Running /usr/bin/env git ls-remote --heads [email protected]/tempdirname-static.git as [email protected] 
DEBUG [3788f5f2] Command: (GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/tempdirname/git-ssh.sh /usr/bin/env git ls-remote --heads [email protected]/tempdirname-static.git) 
DEBUG [3788f5f2] stdin: is not a tty 
DEBUG [3788f5f2] /usr/bin/env: 
DEBUG [3788f5f2] git 
DEBUG [3788f5f2] : No such file or directory 
DEBUG [3788f5f2]  
cap aborted! 
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: git exit status: 127 
git stdout: Nothing written 
git stderr: stdin: is not a tty 
/usr/bin/env: git: No such file or directory 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 
SSHKit::Command::Failed: git exit status: 127 
git stdout: Nothing written 
git stderr: stdin: is not a tty 
/usr/bin/env: git: No such file or directory 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status=' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:66:in `execute' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/git.rb:11:in `git' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/git.rb:21:in `check' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/tasks/git.rake:28:in `block (4 levels) in <top (required)>' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/capistrano-3.4.0/lib/capistrano/tasks/git.rake:27:in `block (3 levels) in <top (required)>' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run' 
/Users/User1/.rvm/gems/ruby-2.1.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute' 
Tasks: TOP => git:check 
The deploy has failed with an error: Exception while executing as [email protected]: git exit status: 127 
git stdout: Nothing written 
git stderr: stdin: is not a tty 
/usr/bin/env: git: No such file or directory 
** Invoke deploy:failed (first_time) 
** Execute deploy:failed 

这是我deploy.rb

# config valid only for Capistrano 3.3.5 
lock "3.4.0" # change the version to the capistrano version you are using - I used capistrano version 3.3.5 

set :application, "name" 
#set :deploy_user, "your-ssh-deploy-user" 
set :deploy_user, "user" 

# setup repo details 
set :repo_url, "[email protected]:user/reponame.git" 
set :scm, :git 

# how many old releases do we want to keep, not much 
set :keep_releases, 2 

这是我production.rb

set :stage, :production # or :staging or :your_environment 
set :branch, "master" # or another branch, for example "development" 

# used in case we're deploying multiple versions of the same 
# app side by side. Also provides quick sanity checks when looking 
# at filepaths 
set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}" 

#server 'your-ip-address', user: 'your-ssh-deploy-user', roles: %w{web app db}, primary: true 
server 'ipaddress', user: 'myuser', roles: %w{web app db}, primary: true 

set :deploy_to, "/home/dir/blah/blah" 

# whether we're using ssl or not, used for building nginx 
# config file 
set :enable_ssl, false 

#role :app, %w{[email protected]} 
#role :web, %w{[email protected]} 
#role :db, %w{[email protected]} 
role :app, %w{[email protected]} 
role :web, %w{[email protected]} 
role :db, %w{[email protected]} 

我跟着这 http://www.frick-web.at/blog/capistrano-deployment-setup-for-php-projects

回答

0

部署用户只是capistrano表示适用于不同上下文(如生产,登台服务器或一般不同服务器)的用户。我陷入了语义学的困境。