Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/require without hooks #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ set :npm_roles, :all # default
set :npm_env_variables, {} # default
```

Alternatively, if you want to have control on the execution of npm tasks

```ruby
# Capfile
require capistrano/npm/without_hooks
```

You can then add the hooks on a per deploy script basis

```ruby
# config/deploy/my_stage_with_npm.rb
before 'deploy:updated', 'npm:install'
```

### Dependencies

npm allows for normal `dependencies` and `devDependencies`. By default this gem uses `'--production --silent --no-progress'` as the install flags which will **only** install `dependencies` and skip `devDependencies`. If you want your `devDependencies` installed as well, then remove `--production`.
Expand Down
2 changes: 1 addition & 1 deletion capistrano-npm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'capistrano-npm'
spec.version = '1.0.2'
spec.version = '1.1.0'
spec.authors = ['Scott Walkinshaw']
spec.email = ['[email protected]']
spec.description = %q{npm support for Capistrano 3.x}
Expand Down
1 change: 1 addition & 0 deletions lib/capistrano/hooks/npm.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
before 'deploy:updated', 'npm:install'
2 changes: 1 addition & 1 deletion lib/capistrano/npm.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
load File.expand_path('../tasks/npm.rake', __FILE__)
load File.expand_path('../tasks/deploy_npm.rake', __FILE__)
1 change: 1 addition & 0 deletions lib/capistrano/npm/without_hooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load File.expand_path('../../tasks/npm.rake', __FILE__)
2 changes: 2 additions & 0 deletions lib/capistrano/tasks/deploy_npm.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
load File.expand_path('../npm.rake', __FILE__)
load File.expand_path('../../hooks/npm.rake', __FILE__)