[deploy] update

This commit is contained in:
2018-01-01 14:33:15 +03:00
parent 4db8f02bc5
commit 61b78ad4d9
7 changed files with 61 additions and 85 deletions

22
config/npm.rb Normal file
View File

@@ -0,0 +1,22 @@
set :npm_path, -> { release_path }
namespace :npm do
task :prepare do
on roles(:all) do
npm_target_path = fetch(:npm_target_path)
npm_path = fetch(:npm_path)
execute "mkdir -p #{npm_target_path}"
execute "cp #{npm_path}/package.json #{npm_target_path}"
end
end
task :link do
on roles(:all) do
npm_target_path = fetch(:npm_target_path)
npm_path = fetch(:npm_path)
execute "ln -s #{npm_target_path}/node_modules #{npm_path}/"
end
end
end
before 'npm:install', 'npm:prepare'
after 'npm:install', 'npm:link'