使用git和capistrano(导轨)在VPS上进行部署

问题描述 投票:1回答:2

晚上好,我有一个VPS,在其中设置git并遵循所有环境(nginx,unicorn,postgresql,rbenv,capistrano,rails,unicorn,nodejs)。

一切似乎都正常,但涉及到一些问题

cap deploy:cold

经过一些更改后,我有了git和要发布在同一VPS上的应用程序,但是由于它要求的密码基本上是无用的,因此我无法正常运行,我理解了这个问题,我在调用存储库,就像使用github之一,似乎错了,但我不知道该用什么来部署它...

deploy.rb

require "bundler/capistrano"

load "config/recipes/base"
load "config/recipes/nginx"
load "config/recipes/unicorn"
load "config/recipes/postgresql"
load "config/recipes/nodejs"
load "config/recipes/rbenv"
load "config/recipes/check"

server "192.192.192.192", :web, :app, :db, primary: true

set :user, "deployer"
set :application, "phs"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false

set :scm, "git"
set :repository, "#{user}@#{server}:/home/deployer/#{application}.git"
set :branch, "master"

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

after "deploy", "deploy:cleanup"

谢谢您的帮助,您在我的第一个应用程序的所有构建中都至关重要

ruby-on-rails git nginx capistrano rbenv
2个回答
0
投票

您正在使用VPS的本地git repo进行部署? 为什么不使用以下方法从github部署:

set :repository, [email protected]:repo_directory/#{application}.git


0
投票

所以我加了

set :normalize_asset_timestamps, false

在ddeploy.rb文件上,我只是非常注意出现在终端中的所有错误,谷歌搜索,尝试并使其最终起作用,但不幸的是,我不记得确切的程序了

© www.soinside.com 2019 - 2024. All rights reserved.