Skip to content
Browse files

create symlinks for uploaded files on deploy

  • Loading branch information...
1 parent 5f44a96 commit b717d7dd696f219451ffaaea5b609a34accd2da0 @ck3g committed Apr 6, 2013
Showing with 19 additions and 12 deletions.
  1. +1 −1 Gemfile
  2. +10 −10 Gemfile.lock
  3. +8 −1 config/deploy.rb
View
2 Gemfile
@@ -46,7 +46,7 @@ group :production do
end
group :development do
- gem "capistrano", :require => false
+ gem "capistrano", "~> 2.14.2", :require => false
gem 'capistrano-recipes', :require => false
gem 'capistrano_colors', :require => false
gem 'capistrano-unicorn', '~> 0.1.6', require: false
View
20 Gemfile.lock
@@ -48,7 +48,7 @@ GEM
mocha (= 0.10.5)
builder (3.0.4)
cancan (1.6.8)
- capistrano (2.14.1)
+ capistrano (2.14.2)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
@@ -122,7 +122,7 @@ GEM
tilt
has_scope (0.5.1)
hashie (1.2.0)
- highline (1.6.15)
+ highline (1.6.16)
hike (1.2.1)
http_parser.rb (0.5.3)
i18n (0.6.1)
@@ -157,13 +157,13 @@ GEM
metaclass (~> 0.0.1)
multi_json (1.7.1)
multipart-post (1.1.5)
- net-scp (1.0.4)
- net-ssh (>= 1.99.1)
- net-sftp (2.0.5)
- net-ssh (>= 2.0.9)
- net-ssh (2.6.3)
- net-ssh-gateway (1.1.0)
- net-ssh (>= 1.99.1)
+ net-scp (1.1.0)
+ net-ssh (>= 2.6.5)
+ net-sftp (2.1.1)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.6.6)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
nokogiri (1.5.6)
orm_adapter (0.4.0)
pg (0.14.1)
@@ -316,7 +316,7 @@ DEPENDENCIES
battlenet_info (= 0.2.1)
bitmask_attributes (~> 0.4.0)
cancan (~> 1.6.8)
- capistrano
+ capistrano (~> 2.14.2)
capistrano-recipes
capistrano-unicorn (~> 0.1.6)
capistrano_colors
View
9 config/deploy.rb
@@ -28,7 +28,7 @@
set :normalize_asset_timestamps, false
after "deploy", "deploy:cleanup"
-after "deploy:finalize_update", "deploy:config"
+after "deploy:finalize_update", "deploy:config", "deploy:update_uploads"
after "deploy:create_symlink", "deploy:migrate"
CONFIG_FILES = %w(database)
@@ -55,6 +55,13 @@
run "cd #{release_path}/config && ln -nfs #{shared_path}/config/#{file}.yml #{release_path}/config/#{file}.yml"
end
end
+
+ task :update_uploads, :roles => [:app] do
+ run "ln -nfs #{deploy_to}#{shared_dir}/uploads #{release_path}/public/uploads"
+ run "ln -nfs #{deploy_to}#{shared_dir}/system #{release_path}/public/system"
+ run "mkdir -p #{release_path}/public/Content"
+ run "ln -nfs #{deploy_to}#{shared_dir}/Gallery #{release_path}/public/Content/Gallery"
+ end
end
desc "Tail production log files"

0 comments on commit b717d7d

Please sign in to comment.
Something went wrong with that request. Please try again.