Deploy
The blokctl deploy command publishes a compiled nanoservice to the NanoServices platform, making it available for execution within your workflows. You can deploy an already-built artifact or let the CLI handle the build process automatically using the --build flag.
This command is flexible enough to support local development, production deployments, and integration into CI/CD pipelines. It allows you to define the service name, source directory, and whether to trigger a build as part of deployment—all through a straightforward CLI interface.
Whether you're deploying from the current directory, a specific build path, or as part of an automated script, blokctl deploy provides a consistent, reliable way to push your nanoservice live.
Deploy Blok
Syntax
npx blokctl deploy [options]Deploys a nanoservice to the NanoServices platform, optionally building it first.
Options:
--name,-n(string): Service name (required). Default: none.--build(boolean): Build before deploying. Default: false.--directory,-d(string): Source directory path. Default: Current working directory.--help,-h(boolean): Show help. Default: false.
Commands:
.: Deploy from the current directory.
Examples
Deploy with build:
npx blokctl deploy -n my-service --buildDeploy existing build:
npx blokctl deploy -n my-service -d ./build-outputDeploy from current directory:
npx blokctl deploy -n my-service .Build and Deploy Example
Build and deploy workflow:
# Build first
npx blokctl build -d ./src
# Then deploy
npx blokctl deploy -n my-service -d ./srcSingle-command build & deploy:
npx blokctl deploy -n my-service --buildCI/CD Pipeline Example:
# In your deployment script
npx blokctl build -d $CODE_DIR
npx blokctl deploy -n $SERVICE_NAME -d $CODE_DIR