Skip to content

MapColonies/config-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Config-Server

This server is the API for MapColonies configuration management system. It is responsible for managing the configuration of the services in the system.

Schemas package

The server depends on the schemas package to load and validate the configuration schemas. The schemas package is a separate package and the server should be updated when a new version of the schemas package is released.

Development

To run the server locally the following steps are required.

  1. Clone the repository
git clone [email protected]:MapColonies/config-server.git
  1. Install the dependencies
npm install
  1. create a local configuration file under the config folder named local.json and fill it with the required configuration. Check the config/default.json file for the required configuration.
  2. Run the migrations
npm run migration:run
  1. Run the server
npm run start:dev

Creating a new migration

To create a new migration file run the following command:

npm run migration:create

Testing

To run the tests run the following command:

npm run test

Make sure you have set the testing configuration.

Deployment

The server is deployed using docker and a helm chart. To build the docker image run the following command:

docker build -t <your-org>/config-server:<tag> .

If needed, it's possible to run the migrations straight from the docker image by running the following command:

docker run --rm <your-org>/config-server:<tag> node ./db/runMi
grations.js

Don't forget to set the required environment variables.