【问题标题】:Capistrano Many Private Repo GithubCapistrano 许多私人回购 Github
【发布时间】:2014-04-22 10:01:15
【问题描述】:

非常奇怪的行为,我无法理解问题出在哪里。 我在 Github 上有 2 个私有存储库,我使用 Capistrano 进行部署。 第一个应用正常部署deploy.rb

require "rvm/capistrano"
require 'bundler/capistrano'

set :rvm_ruby_string, "2.1.0"
set :assets_role, :app
set :normalize_asset_timestamps, false
set :application, "awesome_app_one"

set :scm, :git
set :repository, "git@github.com:myaccount/repo_one.git"
set :branch, :master
set :deploy_via, :remote_cache
set :ssh_options, { forward_agent: true }

set :user, "rails"
set :deploy_to, "/home/rails/#{application}"
set :shared_children,   %w(public/system public/files public/uploads log tmp/pids tmp/sockets)
set :use_sudo,  false

task :production do
  role :web, "123.456.789.0"
  role :app, "123.456.789.0"
  role :db,  "123.456.789.0", primary: true

  set :branch, :master
  set :deploy_to, "/home/rails/#{application}"
  set :rails_env, 'production'
end

另一个应用程序有类似的 deploy.rb 配方和 capistrano 找不到 repo:

> ** [123.456.789.0 :: err] ERROR: Repository not found.
> ** [123.456.789.0 :: err] fatal: The remote end hung up unexpectedly

然后我尝试在服务器上克隆 repo:

$> git clone git@github.com:myaccount/repo_two.git
$> Initialized empty Git repository in /home/rails/repo_two/.git/
$> ERROR: Repository not found.
$> fatal: The remote end hung up unexpectedly

我在repo_onerepo_two 上从服务器添加我的ssh 密钥。看同样的问题here,但没有答案。

更新:

我找到了一些 solution,现在我可以在服务器上克隆 repo,但是有人知道如何告诉 capistrano 使用我的命令来提取 repo?

【问题讨论】:

    标签: ruby-on-rails ruby git github capistrano


    【解决方案1】:

    昨晚出现了这个错误

    我们不得不使用它来解决这个错误:

    set :repository, 'https://username:password@github.com/username/repo.git'
    

    我们正在重构,但它对我们有用

    【讨论】:

    • 我更改了我的set :repository, "https://username:password@github.com/username/repo.git",现在可以部署了。谢谢
    • 很高兴听到它成功了!如果我们让它对数据更加敏感,我会告诉你的。我修改了答案 - 如果它有效,你应该接受
    • 您是否能够提出任何其他使用密钥而不是用户名/密码的解决方案?
    猜你喜欢
    • 2014-05-23
    • 2014-10-17
    • 1970-01-01
    • 2021-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-03
    • 2021-12-16
    相关资源
    最近更新 更多