New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

shipit-roles

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shipit-roles

Assign roles to servers and execute commands on sets of servers with specific roles

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

shipit-roles

The shipit-roles module lets addresses the requirement outlined in this github issue:

https://github.com/shipitjs/shipit/issues/122

If you have a fleet of servers and that are configured in a specialized manner per role, shipit-roles lets you address them as a group during the deploy process. This allows you to restart the web server on only hosts that actually have a web server running or clear the cache on servers that actually keep a cache.

Installation

Install with npm or yarn:

npm install --save shipit-roles

Configuration

When you define your servers, use the following format:

...
servers: [
  {
    user: 'root',
    host: 'app1.example.com',
    role: 'appserver'
  },{
    user: 'root',
    host: 'app2.example.com',
    role: 'appserver'
  },{
    user: 'root',
    host: 'worker1.example.com',
    role: 'worker'
  },{
    user: 'root',
    host: 'worker2.example.com',
    role: 'worker'
  },{
    user: 'root',
    host: 'db1.example.com',
    role: 'database'
  }
]
...

You can have as many roles as you want and they can be identified with whatever word you choose. appserver, worker, and database are merely provided as examples.

Usage

shipit-roles monkey patches the remote() and remoteCopy() functions to accept a role option. If no role is provided, then it defaults to all servers. If a role is specified, then the command will only address the servers with that role.

const roles = require('shipit-roles')

module.exports = function (shipit) {

  roles(shipit)

  shipit.task('deploy:restart_appservers', () => {
    return shipit.remote('service nginx restart', { role: 'appserver' })
  })

  shipit.task('deploy:restart_workers', () => {
    return shipit.remote('service worker restart', { role: 'worker' })
  })

}

Author & Credits

Shipit-roles was written by Greg Kops and is based upon his work with Think Topography and The Cornell Cooperative Extension of Tompkins County

FAQs

Package last updated on 14 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc