Using Capistrano to deploy (a non-Rails site) via FTP?

前端 未结 2 459
一个人的身影
一个人的身影 2021-01-30 18:35

How would I go about this?

I have a mostly static site, which is being hosted on a cheap web-host, which only allows FTP access to the hosting. The site is tracked in gi

2条回答
  •  遇见更好的自我
    2021-01-30 18:56

    We use capistrano to deploy our site which is written in PHP.

    From memory (I'm not at work right now) we overload deploy and used rsync to sync over sftp. Something like this:

    desc "Sync"
    namespace :deploy do
    
      desc "Sync remote by default"
      task :default do
        remote.default
      end
    
      namespace :remote do
    
          desc "Sync to remote server"
          task :default do
              `rsync -avz "/path/to/webapp" "#{remote_host}:#{remote_root}/path/to/webapp"`
          end
      end
    end
    

    I'm sure you could replace rsync with whatever an ftp program and it should work fine.

提交回复
热议问题