什么是Capistrano的部署用户?

时间:2015-11-09 20:18:08

标签: capistrano

我试图绕过卡皮斯特拉诺。

什么是ssh部署用户?我通过ssh访问获得了共享托管空间,我通常使用ssh myuser@domain.com,并使用私有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 myuser@serveripaddress
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 myuser@serveripaddress
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 git@bitbucket.blah/tempdirname-static.git as myuser@serveripaddress
DEBUG [3788f5f2] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/tempdirname/git-ssh.sh /usr/bin/env git ls-remote --heads git@bitbucket.blah/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 myuser@serveripaddress: 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 myuser@serveripaddress: 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, "git@bitbucket.org: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{deploy@your-ip-address}
#role :web, %w{deploy@your-ip-address}
#role :db,  %w{deploy@your-ip-address}
role :app, %w{myuser@myipaddress}
role :web, %w{myuser@myipaddress}
role :db,  %w{myuser@myipaddress}

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

1 个答案:

答案 0 :(得分:0)

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

相关问题