Introduction
Serverize CLI is a command-line tool that allows you to deploy, manage, monitor, and interact with your projects.
It’s currently distributed as an npm package, so you need to have Node.js installed on your machine (or CI/CD environment) to use it.
Before accessing any of Serverize’s features, you need to create an account or log in to your existing one.
Authentication
To create an account, run the following command:
You’ll be prompted to enter your email and password, followed by an organization name and your first project name.
Once your account is successfully created, you need to verify your email address through a link sent to your inbox.
Login
To log in to your account, run:
This will prompt you to enter your email and password.
Logout
To log out from your account, run:
This will clear your authentication token from your machine.
Projects
To list all your projects:
To create a new project:
Note: <project-name>
is an argument, not a flag.
Understanding the Deployment Process
Every Serverize project has two essential components:
- Channels
- Releases
Channels, or environments, are collections of project release histories and their configurations.
When you create a new project, it gets a default channel named dev
and a default release named latest
.
Running:
will deploy the project and tag it as the latest release of the dev
channel.
Releases
When you deploy a project, it creates a new release behind the scene and associate it with a channel.
Unless you specify a release name, the release will be named latest
.
You can only have one release per name; deploying with the same release name will overwrite the previous one.
Listing Releases
Channels
Managing channels is not supported at the moment, however you get 2 channels when you signup, dev, preview
Deployments
Before deploying a project, ensure your Dockerfile is ready and works as expected; it should expose the port your server is listening on.
You can deploy a project by running:
The resulting URL will be:
Examples:
-
Deploying to the
dev
channel with thelatest
release (default options):Resulting URL:
Note: For the
latest
release, the release name doesn’t appear in the URL. -
Deploying to the
dev
channel with a named releasedemo
:Resulting URL:
-
Deploying to the
preview
channel with theregression
release:Resulting URL:
As mentioned, to deploy to a named release, specify the release name:
Note: The default channel is dev
.
To deploy to a specific channel, such as preview
, add the channel name:
Authentication Tokens
To deploy a project in a CI/CD pipeline, you need to create a new token and store it in your CI/CD environment.
To create a new token, run:
Store this token securely as it will only be displayed once. See a complete guide on how to use Serverize with GitHub Actions.
Setup
To auto setup your project (add dockerfile, dockerignore, etc) run:
Where framework
is the framework you want to setup, if not provided, serverize will try to guess it otherwise it’ll ask you.
Example:
- Setup Deno
This command will add Dockerfile as well as dockerignore to your project.
- Setup Astro
- Setup Nuxt
- Auto setup:
Auto setup works by inspecting your project and guessing the framework.