mirror of
https://github.com/moghtech/komodo.git
synced 2026-02-14 16:18:59 -06:00
rename transform to post-build for clarity
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "yarn build && build/monitor-cli.js",
|
||||
"build": "vite build && node transform.mjs && chmod +x build/monitor-cli.js",
|
||||
"build": "vite build && node post-build.mjs && chmod +x build/monitor-cli.js",
|
||||
"publish-cli": "yarn build && cd build && npm publish --access=public && node update-version.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommandLogError } from "@monitor/types";
|
||||
import { Box, Newline, Text, useInput } from "ink";
|
||||
import React, { Fragment, useState } from "react";
|
||||
import { startMongo } from "../../helpers/mongo";
|
||||
import { startMongo } from "../../helpers/deploy/mongo";
|
||||
import LabelledSelector from "../util/LabelledSelector";
|
||||
import YesNo from "../util/YesNo";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommandLogError } from "@monitor/types";
|
||||
import { Box, Newline, Text, useInput } from "ink";
|
||||
import React, { Fragment, useState } from "react";
|
||||
import { startRegistry } from "../../helpers/registry";
|
||||
import { startRegistry } from "../../helpers/deploy/registry";
|
||||
import LabelledSelector from "../util/LabelledSelector";
|
||||
import YesNo from "../util/YesNo";
|
||||
|
||||
|
||||
2
cli/src/config.ts
Normal file
2
cli/src/config.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export const CORE_IMAGE = "mbecker2020/monitor-core";
|
||||
export const PERIPHERY_IMAGE = "mbecker2020/monitor-periphery";
|
||||
@@ -1,4 +1,4 @@
|
||||
import { execute } from "./execute";
|
||||
import { execute } from "../execute";
|
||||
|
||||
export async function startMongo(
|
||||
name: string,
|
||||
16
cli/src/helpers/deploy/monitor.ts
Normal file
16
cli/src/helpers/deploy/monitor.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { CORE_IMAGE } from "../../config";
|
||||
import { Config } from "../../types";
|
||||
import { execute } from "../execute";
|
||||
|
||||
export async function startMonitorCore({
|
||||
monitorCore: {
|
||||
|
||||
},
|
||||
mongo: { url: mongoURL },
|
||||
registry: { url: registryURL },
|
||||
}: Config) {
|
||||
const command = `docker run -d --name monitor-core -e MONGO_URL=${mongoURL}${
|
||||
registryURL ? ` -e REGISTRY_URL=${registryURL}` : ""
|
||||
} ${CORE_IMAGE}`;
|
||||
return await execute(command);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { execute } from "./execute";
|
||||
import { execute } from "../execute";
|
||||
|
||||
export async function startRegistry(
|
||||
name: string,
|
||||
24
cli/src/types.d.ts
vendored
24
cli/src/types.d.ts
vendored
@@ -1,10 +1,28 @@
|
||||
export type Config = {
|
||||
mongoURL: string;
|
||||
registryURL: string;
|
||||
monitorCore: {
|
||||
name: string;
|
||||
|
||||
};
|
||||
mongo: {
|
||||
url: string;
|
||||
deploymentConfig?: {
|
||||
// if mongo container already exists locally running on docker and should be added as a monitor managed deployment
|
||||
};
|
||||
startConfig?: {
|
||||
// if this is attached, the cli will start container with this config and add
|
||||
};
|
||||
};
|
||||
registry: {
|
||||
exists: boolean; // if this is false, dont use a registry and builds will be disabled
|
||||
url?: string;
|
||||
deploymentConfig?: {};
|
||||
startConfig?: {};
|
||||
};
|
||||
};
|
||||
|
||||
export type SetConfig = (
|
||||
field: keyof Config,
|
||||
domain: keyof Config,
|
||||
field: keyof Config[keyof Config],
|
||||
val: string | number | boolean
|
||||
) => void;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"start": "tsc && node build/main.js",
|
||||
"build": "vite build && node transform.mjs && docker build -t mbecker2020/monitor-core .",
|
||||
"build": "vite build && node post-build.mjs && docker build -t mbecker2020/monitor-core .",
|
||||
"docker-run": "docker run -d --name monitor-core --network=\"host\" -v /Users/max/GitHub/monitor/core/secrets:/secrets -v /Users/max/GitHub/monitor/frontend/build:/frontend mbecker2020/monitor-core",
|
||||
"docker-remove": "docker stop monitor-core && docker container rm monitor-core"
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ const ws = fp((app: FastifyInstance, _: {}, done: () => void) => {
|
||||
const messages = createObservable();
|
||||
|
||||
app.decorate(
|
||||
"broadcast",
|
||||
"broadcast", // used to sending state updates to all connected clients
|
||||
<MessageType>(type: string, msg: Action & MessageType) => {
|
||||
msg.type = type;
|
||||
messages.publish(msg);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"start": "tsc && node build/main.js",
|
||||
"build": "vite build && node transform.mjs && docker build -t mbecker2020/monitor-periphery ."
|
||||
"build": "vite build && node post-build.mjs && docker build -t mbecker2020/monitor-periphery ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@monitor/types": "1.0.0",
|
||||
|
||||
Reference in New Issue
Block a user