CLI - viv
Learn how to deploy your serverless to vivgrid.com by viv cli
viv is the command-line interface (CLI) tool for deploying your serverless functions on Vivgrid.
It provides a convenient way to manage your deployments and serverless instances globally.
Installation
To install viv, you can use the following command:
curl "https://bina.egoist.dev/vivgrid/cli?file=viv" | shUsage
viv --help to see all sub-commands.
General Options:
--secret: The application secret of your Vivgrid project.--tool: The name of your serverless function calling service.--api: The URL of the Vivgrid Zipper Service endpoint, the default value ishttps://hosting.vivgrid.com.--env: The environment variables for your serverless function. you can pass multiple--envoptions likeviv deploy . --env OPENWEATHERMAP_API_KEY=token --env GITHUB_API_KEY=token.
You can create a vivgrid.yml file in the root of your project to configure the deployment settings instead of passing the options every time.
viv deploy [FILE]...
This command will deploy your serverless function to Vivgrid hosting.
viv deploy . --env KEY=VALUEManage serverless deployment
Your serverless code will be uploaded to Vivgrid and compiled by viv upload command, after that, you can create the deployments by viv create command.
viv upload
This command will compile your serverless function after uploading to Vivgrid hosting.
viv upload .viv create
This command will create the deployments.
viv createviv remove
This command will delete the deployments.
viv removeManage serverless state
Once the deployment is created, you can manage its state. Requests will be automatically routed to the nearest region through the Vivgrid Geo-distributed Network.
viv status
This command will show the status of the deployments.
viv statusviv help
This command displays all available sub-commands and their usage.
viv helpObservability
viv logs
This command will show the real-time logs of serverless instances across all regions.
viv logsTerminate the logs by pressing Ctrl + C.
vivgrid.yml Configuration File
You can create a vivgrid.yml file in the root of your project to configure the deployment settings.
zipper: zipper.vivgrid.com:9000
secret: <APP_SECRET>
tool: your_tool_namezipper(optional): The URL of the Vivgrid Zipper Service endpoint, the default value iszipper.vivgrid.com:9000.secret: The application secret of your Vivgrid project.tool: The name of your serverless function calling service.
Set Environment Variables
You can set environment variables for your serverless function by passing the --env option.
viv deploy . --env KEY1=VALUE1 --env KEY2=VALUE2