Bootstrap the orchestration service from a common configuration

This commit is contained in:
R Tyler Croy 2019-06-25 20:44:59 -07:00
parent a8f4c889fe
commit 21a4ebadcc
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
4 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
orchestrator:
host: OR_HOST
port: OR_PORT

4
config/default.yml Normal file
View File

@ -0,0 +1,4 @@
---
orchestrator:
host: localhost
port: 3030

View File

@ -0,0 +1,4 @@
= Otto Orchestrator
The Otto Orchestration service is responsible for provisioning agents to do their
necessary work.

View File

@ -3,4 +3,20 @@ require('module-alias/register');
import logger from '@otto/logger';
import { serveApp } from '@otto/server'
import feathers from '@feathersjs/feathers';
import configuration from '@feathersjs/configuration';
import express from '@feathersjs/express';
logger.info('Starting orchestrator');
const app = express(feathers());
// We need to fish out the orchestrator specific settings
const settings = configuration()(app);
app.configure((app) => {
Object.keys(settings['orchestrator']).forEach((key) => {
app.set(key, settings['orchestrator'][key]);
});
});
serveApp(app);