mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
V2 docker (#312)
* Create docker-ci.yml * docker build * add build app * path changes * delete double workflow * update docker run template * cleanup * resolve wierd path issue * wrong path * again wrong path * rename docker releases * move styles population and change to function call * re-add old build pipeline * rename buld file * feractor init function * refactor: startDb to initAssets * refactor: startDB to initAssets * fix: docker.cjs building whole app * fix: docker environment * update docker paths * update: build command * cleanup * cleanup: commented code --------- Co-authored-by: Fabian Posenau <fabian@fphome.de>
This commit is contained in:
@@ -29,6 +29,7 @@ import { eventLoader } from './classes/event-loader/EventLoader.js';
|
||||
import { integrationService } from './services/integration-service/IntegrationService.js';
|
||||
import { logger } from './classes/Logger.js';
|
||||
import { oscIntegration } from './services/integration-service/OscIntegration.js';
|
||||
import { populateStyles } from './modules/loadStyles.js';
|
||||
|
||||
console.log(`Starting Ontime version ${ONTIME_VERSION}`);
|
||||
|
||||
@@ -95,19 +96,19 @@ app.use((error, response) => {
|
||||
|
||||
enum OntimeStartOrder {
|
||||
Error,
|
||||
InitDB,
|
||||
InitAssets,
|
||||
InitServer,
|
||||
InitIO,
|
||||
}
|
||||
|
||||
let step = OntimeStartOrder.InitDB;
|
||||
let step = OntimeStartOrder.InitAssets;
|
||||
let expressServer = null;
|
||||
let oscServer = null;
|
||||
|
||||
const checkStart = (currentState: OntimeStartOrder) => {
|
||||
if (step !== currentState) {
|
||||
step = OntimeStartOrder.Error;
|
||||
throw new Error('Init order error: startDb > startServer > startOsc > startIntegrations');
|
||||
throw new Error('Init order error: initAssets > startServer > startOsc > startIntegrations');
|
||||
} else {
|
||||
if (step === 1 || step === 2) {
|
||||
step = step + 1;
|
||||
@@ -115,9 +116,10 @@ const checkStart = (currentState: OntimeStartOrder) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const startDb = async () => {
|
||||
checkStart(OntimeStartOrder.InitDB);
|
||||
export const initAssets = async () => {
|
||||
checkStart(OntimeStartOrder.InitAssets);
|
||||
await dbLoadingProcess;
|
||||
populateStyles();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user