CaaS
Container management
Deployment

Deployment

Our SDK provides you a CLI to deploy one or several services.

npx warp deploy

Principle

The deploy command is able to deploy a service

Build and deploy

If deploying from a dockerfile, a nodeJs server, or static assets, the platform manages the docker image build for the corresponding service type in a private internal repository, the deployment of the docker image on the selected runner, the setup of the endpoints, the creation of HTTPS certificates and the run on the selected runner.

Deploy an existing docker image

You can also deploy an existing docker image available on a public or private repository. In that case the platform manages the deployment of the docker image on the selected runner, the setup of the endpoints, the creation of HTTPS certificates and the run on the selected runner.

To deploy you need to indicate in which project and in which environment you want to deploy your service. See Project, Environment and working session.

Deploy one or multiple services

The deploy command can be used to deploy one of several services at once.

If no parameter is used, the command will scan inside the directory you run the command.

npx warp deploy

You can also indicate which directory to deploy

npx warp deploy <directory>

To deploy multiple services at once, indicate the list of directories to deploy.

npx warp deploy <directory1> <directory2> <directory3>

Configuration setup

For each directory the command is applied, it searches for a warp.config.js configuration file that indicate how to configure the deployment of the service. You can configure the build or docker to use.

Zero configuration

If there is no configuration file or deployment configuration, the command identifies automatically the deployment configuration in that way:

  • if there is a Dockerfile, it will deploy from the dockerfile and use the deployment type 'docker'
  • if there is a publicor hosting directory, it will deploy static assets and use the deployment type 'hosting'
  • if there is a scripts.start in a package.json, it will deploy a nodeJs server and use the deployment type 'server'

Configuration to deploy an existing docker image

To indicate which image to deploy, add in your configuration file an ìmageobject with properties:

  • name: the name of the image to start the container from. It must follow this format: [<registry>/][<project>/]<name>[:<tag>|@<digest>].

  • credentials.login: login to access the image registry,

  • credentials.password: password to access the image registry

 
module.exports = {
  ...
  image: {
    name: ...,
    credential: {
      login:...,
      password: ...
    },
  }
  ...

First deployment

During the first deployment two additional configurations are required for each container:

  • the public url to use to access the container
  • the runner name to deploy on

These infos can also be specified in the configuration file. But if there are missing, you will have to interactively enter your values.

About urls, we provide random test urls for testing/development, but you can also assigned you custom domain on an container see Use custom domains

Setting service name

To identify each service that is deployed, a service name is assigned to each service.

To assign a name to a service use the configuration file warp.config.js.

For example to assign 'my-service-name' when deploying from a Dockerfile use

module.exports = {
  docker: "my-service-name",
};

If there is a configuration file, the name of the service is used. Otherwise the command line sets automatically a name in that way according to the deployment type:

  • For 'docker' the parent dirname of where is located the Dockerfile is used.
  • For 'server', the package name in package.jsonis used.
  • For 'hosting' the parent dirname of where is located publicor staticis used.

After deployment

After deploying in an environment, you can have info about what has been deployed using

npx warp env info

The command will show you, the url, runners, services and deployments you done in the environment.