GithubHelp home page GithubHelp logo

capistrano-npm's Introduction

capistrano-npm

capistrano-npm is a Capistrano extension that will let you run npm during your deploy process.

Installation

  1. Install the Gem
gem install capistrano-npm

Or if you're using Bundler, add it to your Gemfile:

gem 'capistrano-npm'
  1. Add to Capfile or config/deploy.rb:
require 'capistrano/npm'

Usage

Add the task to your deploy.rb:

after 'deploy:finalize_update', 'npm:install'

And npm install will be run in your in your latest_release path on deploy:finalize_update.

Limitations

There's currently no way to specify a path other than the default latest_releast where npm installs. This will be fixed in a future version.

Optimize

Ideally when using npm, you should add node_modules to your .gitignore file to keep them out of your repository.

Since npm install does not guarantee that you will get the same package versions when deploying, you should use npm shrinkwrap (https://npmjs.org/doc/shrinkwrap.html) first.

Running npm shrinkwrap will created a npm-shrinkwrap.json file that locks down the dependency versions. Check this file into your repository.

Now when deploying, npm install will detect the npm-shrinkwrap.json file and use that to install the packages.

Tasks

  • npm:install: Runs npm install.

Dependencies

This extension also adds the npm command as a Capistrano dependency. Meaning when you run cap deploy:check, it will make sure the npm command exists.

Configuration

  • npm_path: Path to npm bin on the remote server. Defaults to just npm as its assumed to be in your $PATH.
  • npm_options: Options for npm command. Defaults to --production --silent to avoid installing dev dependencies.

capistrano-npm's People

Contributors

swalkinshaw avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.