Code Monkey home page Code Monkey logo

shipit-nvm's Introduction

shipit-nvm

A set of tasks for Shipit used for nvm specific tasks.

Features:

  • Automatically sets a default node version. (nvm alias default triggered on updated,fetched or a custom event. See options below.)
  • Works with shipit-deploy, shipit-npm and shipit-shared
  • Gets node version from .nvmrc
  • Can Unalias/Clean up default node version. (nvm unalias default triggered on custom event. See options below.)
  • Has a direct pass though task to nvm commands.
  • Works via shipit-cli and grunt-shipit

Install

npm install shipit-nvm

Usage

Just simply run: (This triggers the nvm specific tasks on the events mentioned previously. No additional config necessary.)

shipit staging deploy

Or you can run the tasks separately :

  shipit staging nvm:init nvm:alias-default
  shipit staging nvm:init nvm:unalias-default
  shipit staging nvm:run --cmd "update"

Options shipit.config.nvm

nvm.remote

Type: Boolean Default: true

A Boolean to determine whether to run the task in local workspace or on the remote. NOTE: if used with shipit-npm the npm.remote option takes precedence over this one.

nvm.sh

Type: String Default: '/usr/local/nvm/nvm.sh'

An string specifying the absolute path to the nvm.sh file (see nvm readme for more info).

nvm.triggerEvents

nvm.triggerEvents.aliasDefault

Type: String,Boolean Default: updated or fetched (depending on nvm.remote value)

An event name that triggers nvm:alias-default. Can be set to false to prevent the nvm:alias-default task from being fired.

nvm.triggerEvents.unaliasDefault

Type: String,Boolean Default: false

An event name that triggers nvm:unalias-default.

Example shipitfile.js options usage

module.exports = function (shipit) {
  require('shipit-deploy')(shipit);
  require('shipit-nvm')(shipit);

  shipit.initConfig({
    default: {
      nvm: {
        remote: false,
        sh: '~/.nvm/nvm.sh',
        triggerEvents: {
          unaliasDefault: 'npm_installed'
        }
      }
    }
  });
};

License

MIT

shipit-nvm's People

Contributors

geta6 avatar

Watchers

 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.