Capistrano + Git : repository local to production server

后端 未结 5 949
我寻月下人不归
我寻月下人不归 2020-12-08 08:48

I am trying to do \'deploy:cold\' for my app. The git repo is local to my deployment server (i.e. I only have one server for everything and I don\'t host my code on github).

相关标签:
5条回答
  • 2020-12-08 08:57

    If local_repository is set, then Capistrano uses the value of respository from the deployment server and the value of local_respository from the development server. Or something like that.

    My configuration worked like so:

    set :repository, "/home/#{user}/path/to/repo.git"
    set :local_repository, "myserver.com:path/to/repo.git"
    
    0 讨论(0)
  • 2020-12-08 08:59

    Log in as the user of the site you are deploying to and try this to see if your user has permission to access that directory:

    ls -la /home/mrichman/git/myapp.git

    If you get a Permission denied error then you'll have to make sure that you set permissions on the enclosing directories of the repository that allow the deployment script to access the files.

    0 讨论(0)
  • 2020-12-08 09:10

    My problem was actually related to a known-hosts problem. All I had to do was make sure the remote git server was in my known hosts (trying to SSH into it for the first time will prompt you to add this yourself), and it worked like a charm.

    0 讨论(0)
  • 2020-12-08 09:19

    Make sure that you have written the correct git repo with caring case-sensitive writing! (I faced the same problem, it just solved)

    0 讨论(0)
  • 2020-12-08 09:21

    Just ran into the same problem. The key is to not use deploy_via copy but rather set :local_repository

    This should be set to the URL you use to access the repository from your development computer/laptop.

    So mine has

    set :repository, "file:///srv/git/myapp.git"
    set :local_repository, "nameOfHostFromSSHConfig:/srv/git/myapp.git"
    

    Seems to have worked. Just remember to then remove the deploy_via copy line as well.

    0 讨论(0)
提交回复
热议问题