Capistrano deploy fails after I changed the repository URL

前端 未结 10 697
野性不改
野性不改 2021-01-30 01:24

I have a simple deployment via capistrano from a Git repository. At first I was deploying form GitHub, everything worked just fine. But then I moved my repository to BitBucket a

10条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 01:53

    Here's the Capistrano 3 version of what this answer talks about. It might be tedious to do what the answer suggests on each server.

    So drop this in deploy.rb and then run cap deploy:fix_repo_origin

    namespace :deploy do
      desc 'Fix repo origin, for use when changing git repo URLs'
      task :fix_repo_origin do
        on roles(:web) do
          within repo_path do
            execute(:git, "remote set-url origin #{repo_url}")
          end
        end
      end
    end
    

提交回复
热议问题