Service Management

bolt helps you to run your services within Docker, Local, VM's Local or VM's Docker.
By familiarising yourself with Bolt's functionality, you can effectively handle your projects and their services.
Here's a breakdown of how Bolt operates —
  • Each project can have multiple services
  • Bolt init command creates bolt.yaml file for a project
  • Bolt service:add command creates bolt.service.yaml file for each service
  • Bolt up command runs your project
  • Bolt down command shuts down your project's running services
  • Bolt log command allows you to log the service or keep monitoring the service
Let's dig in more into each of these pointers to get you started with Bolt!

Table of Contents

  • Initialise a Project as Bolt Project
  • Add a Service as Bolt Service
  • Listing of Services in a Project
  • Running a Project
  • Running only a specific Service in Project
  • Shutting down only a specific Service in Project
  • Shutting down a Project
  • Logging a Service
  • Monitoring a Service

Initialise a Project as Bolt Project

In order to initialise any project as a Bolt project, you need to run the following command:
$ bolt init
That's it! This command will create a bolt.yaml file in your project's root directory. This file will contain all the information about your project and its services.
Note: At this point, the services index of your yaml file will be empty. We will learn adding a service in the next section.

Add a Service as Bolt Service

In order to add a service to your project, you need to run the following command:
$ bolt service:add <service-name> <service-directory-path>
This command will create a bolt.service.yaml file in your service's directory. This file will contain all the information about your service.
This command has auto detection enabled and we have templates already prepared for few frameworks and libraries to help you with the service creation & configuration. To find out more about available templates, please refer our service:add CLI Reference section.

Listing of Services in a Project

In order to list all the services in your project, you need to run the following command:
$ bolt service:list
This command will list all the services in your project with their statuses and other information.

Running a Project

In order to run your project, you need to run the following command:
$ bolt up
This command will run all the services in your project. If you have not yet added any service to your project, this command will throw an error.

Running only a specific Service in Project

In order to run a specific service in your project, you need to run the following command:
bolt service:up <service-name> --service-runner <local or docker>
This command will run the specified service in your project. If you have not yet added any service to your project, this command will throw an error.

Shutting down only a specific Service in Project

In order to shut down a specific service in your project, you need to run the following command:
bolt service:down <service-name>
This command will shut down the specified service in your project. If you have not yet added any service to your project, this command will throw an error.

Shutting down a Project

In order to shut down your project, you need to run the following command:
$ bolt down
This command will shut down all the services in your project. If you have not yet added any service to your project, this command will throw an error.

Logging a Service

In order to log a service, you need to run the following command:
$ bolt log <service-name>
This command will log the specified service in your project. If you have not yet added any service to your project, this command will throw an error.

Monitoring a Service

In order to monitor a service, you need to run the following command:
$ bolt log --follow <service-name>
This command will monitor the specified service in your project. If you have not yet added any service to your project, this command will throw an error.