Skip to content

olavoparno/should-i-deploy-today

Repository files navigation

traffic

Should I deploy today CI/CD

Should I deploy today? Use it in your CI/CD environment or simply for fun.

Statements Branches Functions Lines
Statements Branches Functions Lines

Table of Contents

Practical example

Example


Installation

  • Install the library in your project as a devDependency:
  npm i -D should-i-deploy-today

Simple Usage

  • Simply run it from the CLI as follows to see whether you should or should not deploy today:
  npm run should-i-deploy-today

Advanced Usage

  • Want it to throw an error on your CI/CD environment? Use --ci argument:
  npm run should-i-deploy-today --ci
  • You may also use CI=true instead:
  CI=true npm run should-i-deploy-today --ci

Output example from a pipeline run on Sunday:

  You should not deploy. I see you deployed on Friday
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! should-i-deploy-today@1.0.0 start: `npm run shouldIDeploy`
  npm ERR! Exit status 1

  • Want it without logging? Try silent mode with --silent argument (note this only works alongside CI option):
  npm run should-i-deploy-today --ci --silent

Output example with --silent option (only throws without logging the message):

  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! should-i-deploy-today@1.0.0 start: `npm run shouldIDeploy`
  npm ERR! Exit status 1

License

should-i-deploy-today is MIT licensed.