How to Configure Capistrano to Deploy from Local Git Repository?

后端 未结 6 2038
别跟我提以往
别跟我提以往 2021-01-30 03:25

What changes do I need to make to the deploy.rb file below to make it deploy my app from a local git repo? If I can\'t deploy from a local repo, can I have capistra

6条回答
  •  情歌与酒
    2021-01-30 03:38

    The deploy_via, :copy has been dropped in version 3.

    https://github.com/capistrano/capistrano/issues/695

    In most cases you should have your code in a online repository like github or bitbucket, and then you just have to set this line in your deploy.rb file:

    set :repo_url, 'git@bitbucket.org:my_account/my_project.git'
    

    Though if you happen to have a repository on the remote server that you are deploying too, then you would change that line in your deploy.rb file to be this:

    set :repo_url, 'file:///home/deploy/bare_repo/my_project.git'
    

    Keep in mind that the three forward slashes are important since the file:// tells capistrano that you are looking for a file, and the preceding slash is needed to point to a root path which would be something like /home/deploy/bare_repo/my_project.git.

提交回复
热议问题