deploying with capistrano with remote git repo but without git running on production server

前端 未结 2 1481
轮回少年
轮回少年 2021-02-03 11:58

I have a remote git repository setup for centralized development within my team. However, the production server that we deploy our applications currently does not have git runni

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-03 12:43

    The solution in your question is close to correct. You'll need to specify your git repository a little differently, though. What you need is:

    set :repository, "someuser@somehost:/home/myproject"
    set :scm, "git"
    set :deploy_via, :copy
    

    There's more examples of how to set up git deployment in your Capistrano gem under lib/capistrano/recipes/deploy/scm/git.rb.

    What happens when you use the copy deploy strategy is that Capistrano clones your git repo to /tmp on your local machine, tars & zips the result, and then transfers it to the server via sftp. The copy strategy also supports copying via scp, but there's no way to tell it to do that without hacking around in the source a bit.

提交回复
热议问题