3
我有一個非常簡單的Capistrano配方,需要部署在非常複雜的硬件堆棧上,我希望有人能指出我要出錯的地方。以不同的用戶運行部署任務
我們的基礎設施的安全性要求我:
- 使用網關
- 部署爲用戶之外的用戶自己
所以,Capistrano的需要:
- 通過網關連接爲
authuser
- 通過網關連接到應用服務器作爲
authuser
- 部署的應用服務器上的文件作爲
deployuser
我知道了這樣做的步驟1和2沒有問題,但重:第3步,它運行儘管我已將跑步者設置爲deployuser
,但部署爲authuser
而不是deployuser
。
這裏是deploy.rb文件的配置部分:
app = "new-app"
auth_user = "authuser"
deploy_user = "deployuser"
set :user, "#{lexer_user}"
set :gateway, "#{auth_user}@<gateway ip address>"
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
# Repository setup
set :application, "#{app}"
set :repository, "[email protected]:#{auth_user}/#{app}.git"
set :scm, :git
set :branch, "master"
set :deploy_via, :remote_cache
set :git_enable_submodules, 1
# Roles
set :admin_runner, "#{deploy_user}"
set :runner, "#{deploy_user}"
role :web, "#{auth_user}@<gateway ip address>"
role :app, "#{auth_user}@<gateway ip address>"
role :db, "#{auth_user}@<gateway ip address>"
# Location
set :deploy_to, "/var/apps/#{app}"
# TASKS -------------------------------------------------
...
任何想法可能是想錯了?
注意:當我運行deploy:setup時,命令運行爲authuser
,正好是我正常部署時出現問題。