Skip to content

Instantly share code, notes, and snippets.

@madwork
Created November 7, 2013 16:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madwork/7357023 to your computer and use it in GitHub Desktop.
Save madwork/7357023 to your computer and use it in GitHub Desktop.
Capistrano (version 2), deploy with Bower. Install into shared directory
before "bower:install", "bower:symlink"
after "bower:install", "bower:prune"
before "deploy:assets:precompile", "bower:install"
namespace :bower do
desc "Symlink shared components to current release"
task :symlink, roles: :app do
run "mkdir -p #{shared_path}/components"
run "ln -nfs #{shared_path}/components #{latest_release}/vendor/assets/components"
end
desc "Install the current Bower environment"
task :install, roles: :app do
run "cd #{latest_release} && /opt/node/bin/node /opt/node/bin/bower install --production --quiet"
end
desc "Uninstalls local extraneous packages"
task :prune, roles: :app do
run "cd #{latest_release} && /opt/node/bin/node /opt/node/bin/bower prune"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment