ruby on rails - How to have one public/.htaccess per stage using capistrano-ext -
i'm using capistrano multistage (capistrano-ext) deploy staging or production.
the problem i'm using passenger in shared hosting , need specify passengerapproot
in public/.htaccess
file. different between stages.
how can keep different "stage-versions" of file?
i haven't used capistrano-ext, i'm assuming somewhere in capfile you'll have stage variable. let's assume it's variable 'stage'. let's assume have 2 different versions checked in somewhere in code (public/.htaccess-{production|staging})
you set task symlink (or copy) right file after deploy:
desc 'set stage-appropriate .htaccess file' task 'update_htaccess' run "ln -s #{release_path}/public/.htaccess-#{stage} #{release_path}/public/.htaccess" end after "deploy:update_code", "update_htaccess"
Comments
Post a Comment