开发者

syncing folder after deploy

开发者 https://www.devze.com 2023-04-02 05:58 出处:网络
Everytime I deploy my redmine repository with capistrano my files are gone. I can see that capistrano symlinks the public directory, but not the {ROOT}/files directory.

Everytime I deploy my redmine repository with capistrano my files are gone. I can see that capistrano symlinks the public directory, but not the {ROOT}/files directory.

I've read some articles on the internet but can't seem to get it work.

So I want is to keep my files in the {APP开发者_StackOverflow中文版ROOT/files} directory after a deploy

Many thanks for reading this.


You have two solutions:

1: Put your files directory in public/shared, which persists over the deployments.

2: Add a task in your capistrano recipe to create the symlink after each deploy:

task :create_files_symlink, :roles => :app do
  run "ln -nfs #{shared_path}/files #{release_path}/files"
end

after 'deploy:update_code', 'create_files_symlink'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号