Prerequisites:
Node.js 14 (LTS) and npm 6 are required. Most package managers will support their installation. Some common examples are provided.
# red hat, centos
sudo dnf install -y nodejs
# ubuntu, mint, debian
sudo apt-get update && sudo apt-get install -y nodejs
Alternatively, use nvm to select a specific version for install. This project uses 14.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
source ~/.bashrc
nvm install v14 --lts
The OpenShift Origin CLI is required for OpenShift-related nrdk commands.
curl https://mirror.openshift.com/pub/openshift-v3/clients/3.11.286/linux/oc.tar.gz | tar zxf - -C /usr/local/bin
Install dependencies.
npm ci
Build TypeScript files from ./src/ into ./lib/ as JavaScript. Repeat as changes are made.
npm run build
Link nrdk, allowing it to be run like any other local package. Sudo may be required.
npm link
# OR sudo npm link
Run nrdk from any directory:
nrdk (-v|--version|version)
nrdk --help [COMMAND]
Optional: Login to OpenShift using a token from the web console. It will resemble the following:
oc login --token=<VARIES> --server=https://api.silver.devops.gov.bc.ca:6443
From the repository root new versions of nrdk may be published. Expect changes in package.json
and package-lock.json
.
npm run publish:latest
Please keep dependencies to a minimum. This package is frequently run with npx
, making size and performance issues much more apparent if bloat sets in. Ideally bundled packages will be as lean as possible, including swapping larger packager for smaller ones.
Development dependencies should be carefully selected, but will not have the same impact on performance.
This is useful to starting quickly, but not very practical, since nrdk is typically run from a separate app's git repository.
-
Run nrdk interactively in a container.
cd dev docker-compose run nrdk
-
Login to oc using an OpenShift Web Console token.
[container]$ oc login https://console.pathfinder.gov.bc.ca:8443 --token=<REDACTED>
-
Run nrdk.
[container]$ nrdk [COMMANDS] [-FLAGS]
-
The container stops automatically when exited
[container]$ exit