简体   繁体   English

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

[英]Deploying on VPS with git and capistrano (rails)

Good evening, i have a VPS in which i set up git and following all the environment (nginx, unicorn, postgresql, rbenv, capistrano, rails, unicorn, nodejs). 晚上好,我有一个VPS,在其中设置git并遵循所有环境(nginx,unicorn,postgresql,rbenv,capistrano,rails,unicorn,nodejs)。

Everything seems working fine, but I encounter some issues when it comes to 一切似乎都正常,但涉及到一些问题

cap deploy:cold

After some changes i have git and the app i want to publish on the same VPS, but i can't get it working since it's asking for different passwords which are basicly useless, i understood the issue, i'm calling the repository like using one of github and seems wrong but i don't know what to use to make it to deploy... 经过一些更改后,我有了git和要发布在同一VPS上的应用程序,但是由于它要求的密码基本上是无用的,因此我无法正常运行,我理解了这个问题,我在调用存储库,就像使用github之一,似乎错了,但我不知道该用什么来部署它...

deploy.rb 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"

thank you for the help, you were essential in all the building of my first app 谢谢您的帮助,您在我的第一个应用程序的所有构建中都至关重要

You are deploying using the VPS's local git repo? 您正在使用VPS的本地git repo进行部署? Why not deploy from github with: 为什么不使用以下方法从github部署:

set :repository, git@github.com:repo_directory/#{application}.git

?

So i added 所以我加了

set :normalize_asset_timestamps, false

on the ddeploy.rb file and i just made great attention to all kind of errors that were put in terminal, googling, trying and making it work eventually i made it work, sadly i can't remember the exact procedures 在ddeploy.rb文件上,我只是非常注意出现在终端中的所有错误,谷歌搜索,尝试并使其最终起作用,但不幸的是,我不记得确切的程序了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM