File uploads lost during deployment
Posted: 06 January 2010 11:46 AM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  132
Joined  2009-10-02

I had written some code that stores some uploads in /public/files/ and they get lost during deployment.

Should I modify the deploy.rb or just copy the files to my local svn directory?

Profile
 
 
Posted: 06 January 2010 12:07 PM   [ Ignore ]   [ # 1 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

The good news is that your uploads aren’t gone. They’re residing in one of the previous release folders. This article explains the process of managing uploads with Capistrano better than I ever could:

http://www.simonecarletti.com/blog/2009/02/capistrano-uploads-folder/

Profile
 
 
Posted: 06 January 2010 12:19 PM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  132
Joined  2009-10-02

Thanks I’ll take a look at the article. I already moved the files for now, using ssh.

Profile
 
 
Posted: 07 January 2010 02:47 PM   [ Ignore ]   [ # 3 ]
Sr. Member
RankRankRankRank
Total Posts:  132
Joined  2009-10-02

After looking at the article it looks like I might have a one line fix.

I made a folder /opt/ublip/rails/shared/uploads and copied the current bunch of image files in it

inside of deploy.rb there’s ablock that starts with

task :symlink_configs

if I add this

ln -nfs #{shared_path}/uploads #{release_path}/public/files

that should solve my problem. Right???

Profile
 
 
Posted: 07 January 2010 04:02 PM   [ Ignore ]   [ # 4 ]
Sr. Member
RankRankRankRank
Total Posts:  132
Joined  2009-10-02

Worked fine when I deployed, I guess I answered my own question.

Profile
 
 
Posted: 07 January 2010 04:25 PM   [ Ignore ]   [ # 5 ]
Administrator
RankRankRankRank
Total Posts:  249
Joined  2008-12-18

Yeah. So you did the symlink similar to the way we do symlinks for database.yml and mongrel_cluster.yml. Good idea.

Profile