@tegrus/cli
v3.10.1
Published
[![npm version](https://img.shields.io/npm/v/@tegrus/cli.svg?style=flat-square)](https://www.npmjs.org/package/@tegrus/cli) [![XO code style](https://shields.io/badge/code_style-5ed9c7?logo=xo&labelColor=gray)](https://github.com/xojs/xo) [![Types in JS](
Downloads
117
Readme
tegrus-cli
Utility commands used by Tegrus. Cross-platform.
Install
Using pnpm:
pnpm add -g @tegrus-cli
Using npm:
npm i -g @tegrus-cli
Usage
After installation, the cli will be available via the tegrus command name:
❯ tegrus --help
Usage: tegrus [options] [command]
Tegrus CLI with utilities like: deployments, etc
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
kubernetes
s3
help [command] display help for command
Commands
Kubernetes
Utility commands for interacting with kubernetes.
Deploy command
❯ tegrus kubernetes deploy --help
Usage: tegrus kubernetes deploy [options]
Deploy docker images to kubernetes
Options:
-n, --namespace <string> The kubernetes namespace
-r, --resource <string> The kubernetes resource name
-t, --type <type> The kubernetes resource type [deployment, statefulset]
-i, --image <string> The image name to update
-o, --host <string> Kubernetes host name
-a, --access-token <string> Kubernetes user access token
-s, --skip-check Skip deployment check (default: false)
--dry-run Dry run deployment (default: false)
--sleep <miliseconds> Time between statuses check in ms (default: 5000)
--timeout <seconds> Script timeout in seconds (default: 30)
--verbose Log aditional info and errors (default: false)
-h, --help display help for command
S3
Utility commands for interacting with any S3-compatible object storage, such as AWS S3, Digital Ocean Spaces, etc.
Sync command
❯ tegrus s3 sync --help
Usage: tegrus s3 sync [options]
Sync source and destination folder. Local and S3 paths can be used
Options:
-s, --source <string> Source path
-t, --target <string> Destination path
-e, --spaces-key <string> Digital ocean spaces key
-r, --spaces-secret <string> Digital ocean spaces secret
-d, --del To delete non-existing files on destination (default: false)
-a, --acl Set objects ACL <string>
--dry-run Dry run deployment (default: false)
--verbose Log aditional info and errors (default: false)
-h, --help display help for command
Usage via npx
npx @tegrus/cli [command] [options]
The cli can be used directly via npx, like in the following gitlab-ci.yml snippet:
deploy:
stage: deploy
image: node:18-alpine
only:
- tags
when: manual
needs:
- build
script:
- >
npx @tegrus/cli@3 s3 sync
--source ./dist
--target s3://cdn-isc.tegrus.io
--spaces-key $SPACES_KEY
--spaces-secret $SPACES_SECRET
Or
.deploy_kubernetes:
stage: deploy
image: node:18-alpine
script:
- >
npx @tegrus/cli@3 kubernetes deploy
--namespace $DEPLOY_NAMESPACE
--resource $DEPLOY_RESOURCE
--type deployment
--image $CI_REGISTRY_IMAGE:$CONTAINER_TAG
--host $KUBERNETES_PROD_HOST
--access-token $KUBERNETES_PROD_ACCESS_TOKEN