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:
Fabian Posenau
2023-03-28 20:12:44 +02:00
committed by GitHub
parent bca7ad30b1
commit 03d5389540
13 changed files with 230 additions and 103 deletions
+7 -5
View File
@@ -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();
};
/**