Deploying a Git subdirectory in Capistrano

前端 未结 11 1400
梦谈多话
梦谈多话 2020-12-07 09:03

My master branch layout is like this:

/ <-- top level

/client <-- desktop client source files

/server

11条回答
  •  旧巷少年郎
    2020-12-07 09:42

    This has been working for me for a few hours.

    # Capistrano assumes that the repository root is Rails.root
    namespace :uploads do
      # We have the Rails application in a subdirectory rails_app
      # Capistrano doesn't provide an elegant way to deal with that
      # for the git case. (For subversion it is straightforward.)
      task :mv_rails_app_dir, :roles => :app do
        run "mv #{release_path}/rails_app/* #{release_path}/ "
      end
    end
    
    before 'deploy:finalize_update', 'uploads:mv_rails_app_dir'
    

    You might declare a variable for the directory (here rails_app).

    Let's see how robust it is. Using "before" is pretty weak.

提交回复
热议问题