jvelezpo-pager-cli

4.3.9 • Public • Published

Introduction

Pager CLI is an NPM module that exposes a set of cli commands that can be used to monitor the health of a subset of Pager's systems. Checkout the Basic Usage section for an example use case.

Installation

  • Clone project to your local
  • run npm install -g from the command line
  • expose Github access token through your shell as GITHUB_ACCESS_TOKEN. Follow the steps here to generate a Github access token. Important Provision the token to minimal permissions to get the data you need (read only is enough). Below is a set of permissions that will work with pager-cli commands.
  • repo
    • enable repo:status
    • enable repo_deployment Access deployment status
    • enable public_repo Access public repositories
    • enable repo:invite Access repository invitations
  • admin:org
    • enable read:org Read org and team membership
  • admin:public_key
    • enable read:public_key Read user public keys
  • admin:repo_hook Full control of repository hooks
    • read:repo_hook Read repository hooks

Deploy shas

A table of deploy shas across Pager's environments can be generated by running pager get deploy-shas. To display all data, certain permissions need to be granted via Github and Aptible. If --convert-to-csv command option is present, then a csv file corresponding to the deploy-sha table will be created in the pager-cli/data/deploy-shas directory.

If you do not have permissions, you can view previous (possibly out of date) deploy-sha reports here: https://docs.google.com/spreadsheets/d/1wnF1HXoWWC5K9kE2fnxnNIOFhSxF9sWLPsckGqUjF-4/edit?usp=sharing

Basic Commands

  • pager get migration-data returns a table of backend apps and the versions of hapi, lab, and code currently used by the applications.
  • pager get pr-count returns a table of PR counts for each backend app.
  • pager -h returns a help menu
  • pager get deploy-shas [row-filter] [column-filter] returns a table of deploy shas across apps and environments.
    • row-filter takes app name. To filter by multiple apps, use multiple flags.
    • column-filter takes environment name (i.e. env-*). To filter by multiple environments, use multiple flags.
  • pager get auth-code [email] [first-name] [last-name] [private-key]
    • keys
    • email should not contain @whatever.com
  • pager get hrz-auth-code [first-name] [last-name] [private-key] : for generating authcode for mock horizon patients

Using with npx

Another option is to use this CLI, without installation is using npx:

  • Instead of pager get migration-data you can run npx -p @pager/pager-cli.js pager get migration-data

Readme

Keywords

none

Package Sidebar

Install

npm i jvelezpo-pager-cli

Weekly Downloads

0

Version

4.3.9

License

ISC

Unpacked Size

126 kB

Total Files

52

Last publish

Collaborators

  • sebasvelezpager