hotstaq 0.6.91 → 0.6.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/build/src/HotBuilder.d.ts +1 -5
- package/build/src/HotBuilder.d.ts.map +1 -1
- package/build/src/HotBuilder.js +43 -48
- package/build/src/HotBuilder.js.map +1 -1
- package/build/src/HotCLI.d.ts +8 -0
- package/build/src/HotCLI.d.ts.map +1 -1
- package/build/src/HotCLI.js +95 -18
- package/build/src/HotCLI.js.map +1 -1
- package/build/src/HotCreator.d.ts.map +1 -1
- package/build/src/HotCreator.js.map +1 -1
- package/build/src/HotGenerator.d.ts +2 -1
- package/build/src/HotGenerator.d.ts.map +1 -1
- package/build/src/HotGenerator.js.map +1 -1
- package/build/src/HotSite.d.ts +311 -0
- package/build/src/HotSite.d.ts.map +1 -0
- package/build/src/HotSite.js +3 -0
- package/build/src/HotSite.js.map +1 -0
- package/build/src/HotStaq.d.ts +1 -310
- package/build/src/HotStaq.d.ts.map +1 -1
- package/build/src/HotStaq.js +2 -2
- package/build/src/HotStaq.js.map +1 -1
- package/build/src/HotTestMap.d.ts +1 -1
- package/build/src/HotTesterServer.d.ts.map +1 -1
- package/build/src/HotTesterServer.js +1 -1
- package/build/src/HotTesterServer.js.map +1 -1
- package/build/src/api-web.js.map +1 -1
- package/build/src/api.d.ts +2 -1
- package/build/src/api.d.ts.map +1 -1
- package/build/src/api.js.map +1 -1
- package/build-web/HotStaq.js +2 -2
- package/build-web/HotStaq.min.js +2 -2
- package/builder/docker/Dockerfile.hardened.linux.gen +0 -2
- package/builder/docker/Dockerfile.linux.gen +1 -1
- package/builder/docker/README.md +9 -2
- package/builder/docker/app/start-pkg.sh +8 -1
- package/builder/docker/app/start.sh +8 -1
- package/builder/{docker-compose → docker}/docker-compose.gen.yaml +17 -14
- package/builder/{docker-compose → docker}/env-skeleton +2 -0
- package/builder/docker/scripts/start.bat +9 -0
- package/builder/docker/scripts/start.sh +9 -0
- package/builder/docker/scripts/stop.bat +9 -0
- package/builder/docker/scripts/stop.sh +9 -0
- package/package.json +1 -1
- package/src/HotBuilder.ts +24 -44
- package/src/HotCLI.ts +82 -6
- package/src/HotCreator.ts +2 -2
- package/src/HotGenerator.ts +2 -1
- package/src/HotSite.ts +314 -0
- package/src/HotStaq.ts +4 -316
- package/src/HotTestMap.ts +1 -1
- package/src/HotTesterServer.ts +1 -1
- package/src/api-web.ts +2 -2
- package/src/api.ts +2 -2
- package/builder/docker/scripts/start-app.bat +0 -10
- package/builder/docker/scripts/start-app.sh +0 -10
- package/builder/docker/scripts/stop-app.bat +0 -5
- package/builder/docker/scripts/stop-app.sh +0 -5
- package/builder/docker-compose/scripts/start.bat +0 -3
- package/builder/docker-compose/scripts/start.sh +0 -3
- package/builder/docker-compose/scripts/stop.bat +0 -3
- package/builder/docker-compose/scripts/stop.sh +0 -3
package/README.md
CHANGED
|
@@ -101,6 +101,12 @@ You can configure how HotStaq starts by using:
|
|
|
101
101
|
* Default: 10
|
|
102
102
|
* Accepted values:
|
|
103
103
|
* Any integer.
|
|
104
|
+
* JSON_LIMIT
|
|
105
|
+
* Type: string
|
|
106
|
+
* Description: The maximum amount of JSON that can be uploaded.
|
|
107
|
+
* Default: 1mb
|
|
108
|
+
* Accepted values:
|
|
109
|
+
* Any string.
|
|
104
110
|
* LOGGING_LEVEL
|
|
105
111
|
* Type: string
|
|
106
112
|
* Description: The logging level to use.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HotSite } from "./
|
|
1
|
+
import { HotSite } from "./HotSite";
|
|
2
2
|
import { HotLog } from "./HotLog";
|
|
3
3
|
/**
|
|
4
4
|
* Builds stuff for the CLI like docker images and Kubernetes Helm charts.
|
|
@@ -33,10 +33,6 @@ export declare class HotBuilder {
|
|
|
33
33
|
* Will append the docker documentation to the existing README.md.
|
|
34
34
|
*/
|
|
35
35
|
appendReadMe: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Will build the Docker compose file.
|
|
38
|
-
*/
|
|
39
|
-
dockerCompose: boolean;
|
|
40
36
|
/**
|
|
41
37
|
* Will build a Kubernetes Helm Chart.
|
|
42
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotBuilder.d.ts","sourceRoot":"","sources":["../../src/HotBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HotBuilder.d.ts","sourceRoot":"","sources":["../../src/HotBuilder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AACH,qBAAa,UAAU;IAEtB;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;OAGG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;gBAEL,MAAM,EAAE,MAAM;IAc3B;;;;OAIG;IACG,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAwI7B;;OAEG;cACa,iBAAiB,CAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAatG"}
|
package/build/src/HotBuilder.js
CHANGED
|
@@ -70,7 +70,6 @@ var HotBuilder = /** @class */ (function () {
|
|
|
70
70
|
this.dockerFiles = true;
|
|
71
71
|
this.dockerHardenSecurity = true;
|
|
72
72
|
this.appendReadMe = true;
|
|
73
|
-
this.dockerCompose = false;
|
|
74
73
|
this.helmChart = false;
|
|
75
74
|
this.hotsites = [];
|
|
76
75
|
this.logger = logger;
|
|
@@ -83,7 +82,7 @@ var HotBuilder = /** @class */ (function () {
|
|
|
83
82
|
*/
|
|
84
83
|
HotBuilder.prototype.build = function () {
|
|
85
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
-
var hotPackageJSONStr, hotPackageJSONObj, dockerDir, dockerFilePath, iIdx, hotsite, hotsiteName, outputDir, dockerfilePortsStr,
|
|
85
|
+
var hotPackageJSONStr, hotPackageJSONObj, dockerDir, dockerFilePath, iIdx, hotsite, hotsiteName, outputDir, dockerfilePortsStr, httpPort, httpsPort, httpApiPort, httpsApiPort, hotsitePath, appCmds, replaceKeys, prevREADME, dockerREADME;
|
|
87
86
|
return __generator(this, function (_a) {
|
|
88
87
|
switch (_a.label) {
|
|
89
88
|
case 0: return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(__dirname, "/../../package.json")))];
|
|
@@ -98,7 +97,7 @@ var HotBuilder = /** @class */ (function () {
|
|
|
98
97
|
/// @todo Finish this...
|
|
99
98
|
this.logger.info("Finished building web API...");
|
|
100
99
|
}
|
|
101
|
-
if (!(this.dockerFiles === true)) return [3 /*break*/,
|
|
100
|
+
if (!(this.dockerFiles === true)) return [3 /*break*/, 27];
|
|
102
101
|
this.logger.info("Building docker files...");
|
|
103
102
|
dockerDir = ppath.normalize("".concat(__dirname, "/../../builder/docker"));
|
|
104
103
|
dockerFilePath = "";
|
|
@@ -113,7 +112,7 @@ var HotBuilder = /** @class */ (function () {
|
|
|
113
112
|
iIdx = 0;
|
|
114
113
|
_a.label = 2;
|
|
115
114
|
case 2:
|
|
116
|
-
if (!(iIdx < this.hotsites.length)) return [3 /*break*/,
|
|
115
|
+
if (!(iIdx < this.hotsites.length)) return [3 /*break*/, 26];
|
|
117
116
|
hotsite = this.hotsites[iIdx];
|
|
118
117
|
this.logger.info("Building Dockerfile \"".concat(hotsite.name, "\"..."));
|
|
119
118
|
if (hotsite.name == null)
|
|
@@ -122,33 +121,37 @@ var HotBuilder = /** @class */ (function () {
|
|
|
122
121
|
hotsiteName = hotsite.name;
|
|
123
122
|
outputDir = ppath.normalize("".concat(this.outputDir, "/"));
|
|
124
123
|
dockerfilePortsStr = "";
|
|
125
|
-
dockercomposeAppPortsStr = "";
|
|
126
|
-
dockercomposeAppAPIPortsStr = "";
|
|
127
124
|
httpPort = HotStaq_1.HotStaq.getValueFromHotSiteObj(hotsite, ["server", "ports", "http"]);
|
|
128
125
|
httpsPort = HotStaq_1.HotStaq.getValueFromHotSiteObj(hotsite, ["server", "ports", "https"]);
|
|
126
|
+
httpApiPort = HotStaq_1.HotStaq.getValueFromHotSiteObj(hotsite, ["server", "ports", "apiHttp"]);
|
|
127
|
+
httpsApiPort = HotStaq_1.HotStaq.getValueFromHotSiteObj(hotsite, ["server", "ports", "apiHttps"]);
|
|
129
128
|
hotsitePath = "/app/".concat(hotsiteName, "/HotSite.json");
|
|
130
129
|
return [4 /*yield*/, HotIO_1.HotIO.mkdir("".concat(outputDir, "/docker/").concat(hotsiteName, "/app/"))];
|
|
131
130
|
case 3:
|
|
132
131
|
_a.sent();
|
|
133
132
|
if (httpPort != null) {
|
|
134
133
|
dockerfilePortsStr += "ARG HTTP_PORT=".concat(httpPort, "\nENV HTTP_PORT ${HTTP_PORT}\nEXPOSE ${HTTP_PORT}");
|
|
135
|
-
dockercomposeAppPortsStr += "\n ports:\n - \"".concat(httpPort, ":").concat(httpPort, "\"");
|
|
136
134
|
}
|
|
137
135
|
if (httpsPort != null) {
|
|
138
136
|
dockerfilePortsStr += "ARG HTTPS_PORT=".concat(httpsPort, "\nENV HTTPS_PORT ${HTTPS_PORT}\nEXPOSE ${HTTPS_PORT}");
|
|
139
|
-
dockercomposeAppPortsStr += "\n\t\t\t\t\t- \"".concat(httpsPort, ":").concat(httpsPort, "\"");
|
|
140
137
|
}
|
|
141
138
|
if (dockerfilePortsStr === "") {
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
httpPort = 5000;
|
|
140
|
+
dockerfilePortsStr += "ARG HTTP_PORT=5000\nENV HTTP_PORT ${HTTP_PORT}\nEXPOSE ${HTTP_PORT}";
|
|
144
141
|
}
|
|
142
|
+
if (httpApiPort == null)
|
|
143
|
+
httpApiPort = 5001;
|
|
144
|
+
appCmds = "\"/app/hotapp\",";
|
|
145
|
+
if (this.dockerHardenSecurity === false)
|
|
146
|
+
appCmds = "\"node\", \"./cli.js\",";
|
|
145
147
|
replaceKeys = {
|
|
148
|
+
APP_CMDS: appCmds,
|
|
146
149
|
NAMESPACE: this.dockerNamespace,
|
|
147
150
|
HOTSITE_NAME: hotsiteName,
|
|
148
151
|
REAL_HOTSTAQ_VERSION: this.hotstaqVersion,
|
|
149
152
|
DOCKERFILE_PORTS: dockerfilePortsStr,
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
HTTP_PORT: httpPort.toString(),
|
|
154
|
+
API_HTTP_PORT: httpApiPort.toString(),
|
|
152
155
|
HOTSITE_PATH: hotsitePath
|
|
153
156
|
};
|
|
154
157
|
return [4 /*yield*/, HotIO_1.HotIO.copyFile(dockerFilePath, "".concat(outputDir, "/docker/").concat(hotsiteName, "/Dockerfile"))];
|
|
@@ -166,69 +169,61 @@ var HotBuilder = /** @class */ (function () {
|
|
|
166
169
|
return [4 /*yield*/, HotIO_1.HotIO.copyFile("".concat(dockerDir, "/dockerignore"), "".concat(outputDir, "/.dockerignore"))];
|
|
167
170
|
case 8:
|
|
168
171
|
_a.sent();
|
|
169
|
-
return [4 /*yield*/,
|
|
172
|
+
return [4 /*yield*/, HotIO_1.HotIO.copyFile("".concat(dockerDir, "/docker-compose.gen.yaml"), "".concat(outputDir, "/docker-compose.yaml"))];
|
|
170
173
|
case 9:
|
|
171
174
|
_a.sent();
|
|
172
|
-
return [4 /*yield*/,
|
|
175
|
+
return [4 /*yield*/, HotIO_1.HotIO.copyFile("".concat(dockerDir, "/env-skeleton"), "".concat(outputDir, "/env-skeleton"))];
|
|
173
176
|
case 10:
|
|
174
177
|
_a.sent();
|
|
175
|
-
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/
|
|
178
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/docker/").concat(hotsiteName, "/app/start.sh"), replaceKeys)];
|
|
176
179
|
case 11:
|
|
177
180
|
_a.sent();
|
|
178
|
-
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/
|
|
181
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/docker/").concat(hotsiteName, "/app/start-pkg.sh"), replaceKeys)];
|
|
179
182
|
case 12:
|
|
180
183
|
_a.sent();
|
|
181
|
-
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/
|
|
184
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/docker-compose.yaml"), replaceKeys)];
|
|
182
185
|
case 13:
|
|
183
186
|
_a.sent();
|
|
184
|
-
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/
|
|
187
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/build.bat"), replaceKeys)];
|
|
185
188
|
case 14:
|
|
186
189
|
_a.sent();
|
|
187
|
-
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/
|
|
190
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/build.sh"), replaceKeys)];
|
|
188
191
|
case 15:
|
|
189
192
|
_a.sent();
|
|
190
|
-
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/
|
|
193
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/start.bat"), replaceKeys)];
|
|
191
194
|
case 16:
|
|
192
195
|
_a.sent();
|
|
193
|
-
return [4 /*yield*/,
|
|
196
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/start.sh"), replaceKeys)];
|
|
194
197
|
case 17:
|
|
195
|
-
|
|
196
|
-
return [4 /*yield*/,
|
|
198
|
+
_a.sent();
|
|
199
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/stop.bat"), replaceKeys)];
|
|
197
200
|
case 18:
|
|
198
|
-
|
|
199
|
-
return [4 /*yield*/,
|
|
201
|
+
_a.sent();
|
|
202
|
+
return [4 /*yield*/, this.replaceKeysInFile("".concat(outputDir, "/stop.sh"), replaceKeys)];
|
|
200
203
|
case 19:
|
|
201
|
-
dockerREADME = _a.sent();
|
|
202
|
-
if (!(prevREADME.indexOf("Docker Getting Started") < 0)) return [3 /*break*/, 21];
|
|
203
|
-
return [4 /*yield*/, HotIO_1.HotIO.writeTextFile("".concat(outputDir, "/README.md"), "".concat(prevREADME, "\n").concat(dockerREADME))];
|
|
204
|
-
case 20:
|
|
205
204
|
_a.sent();
|
|
206
|
-
|
|
205
|
+
return [4 /*yield*/, HotIO_1.HotIO.exists("".concat(outputDir, "/README.md"))];
|
|
206
|
+
case 20:
|
|
207
|
+
if (!((_a.sent()) === true)) return [3 /*break*/, 24];
|
|
208
|
+
return [4 /*yield*/, HotIO_1.HotIO.readTextFile("".concat(outputDir, "/README.md"))];
|
|
207
209
|
case 21:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
prevREADME = _a.sent();
|
|
211
|
+
return [4 /*yield*/, HotIO_1.HotIO.readTextFile("".concat(dockerDir, "/README.md"))];
|
|
210
212
|
case 22:
|
|
211
|
-
|
|
212
|
-
return [3 /*break*/,
|
|
213
|
+
dockerREADME = _a.sent();
|
|
214
|
+
if (!(prevREADME.indexOf("Docker Getting Started") < 0)) return [3 /*break*/, 24];
|
|
215
|
+
return [4 /*yield*/, HotIO_1.HotIO.writeTextFile("".concat(outputDir, "/README.md"), "".concat(prevREADME, "\n").concat(dockerREADME))];
|
|
213
216
|
case 23:
|
|
214
|
-
|
|
217
|
+
_a.sent();
|
|
215
218
|
_a.label = 24;
|
|
216
219
|
case 24:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
dockerDir = ppath.normalize("".concat(__dirname, "/../../builder/docker-compose"));
|
|
220
|
-
return [4 /*yield*/, HotIO_1.HotIO.readTextFile(ppath.normalize("".concat(dockerDir, "/docker-compose.gen.yaml")))];
|
|
220
|
+
this.logger.info("Finished building Dockerfile \"".concat(hotsite.name, "\"..."));
|
|
221
|
+
_a.label = 25;
|
|
221
222
|
case 25:
|
|
222
|
-
|
|
223
|
-
return [
|
|
223
|
+
iIdx++;
|
|
224
|
+
return [3 /*break*/, 2];
|
|
224
225
|
case 26:
|
|
225
|
-
|
|
226
|
-
for (iIdx = 0; iIdx < this.hotsites.length; iIdx++) {
|
|
227
|
-
hotsite = this.hotsites[iIdx];
|
|
228
|
-
this.logger.info("Building Docker Compose files...");
|
|
229
|
-
this.logger.info("Finished building Docker Compose \"".concat(hotsite.name, "\"..."));
|
|
230
|
-
}
|
|
231
|
-
this.logger.info("Finished building Docker Compose files...");
|
|
226
|
+
this.logger.info("Finished building docker files...");
|
|
232
227
|
_a.label = 27;
|
|
233
228
|
case 27: return [2 /*return*/];
|
|
234
229
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotBuilder.js","sourceRoot":"","sources":["../../src/HotBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA8B;AAC9B,iCAAgC;AAEhC,
|
|
1
|
+
{"version":3,"file":"HotBuilder.js","sourceRoot":"","sources":["../../src/HotBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA8B;AAC9B,iCAAgC;AAEhC,qCAAoC;AAIpC;;GAEG;AACH;IA4CC,oBAAa,MAAc;QAE1B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CA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E,CAAA;;;wBA+FtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,mCAAmC,CAAC,CAAC;;;;;;KAExD;IAED;;OAEG;IACa,sCAAiB,GAAjC,UAAmC,QAAgB,EAAE,IAAiC;;;;;4BAE9D,qBAAM,aAAK,CAAC,YAAY,CAAE,QAAQ,CAAC,EAAA;;wBAAtD,QAAQ,GAAW,SAAmC;wBAE1D,KAAS,GAAG,IAAI,IAAI,EACpB;4BACK,KAAK,GAAW,IAAI,CAAC,GAAG,CAAC,CAAC;4BAE9B,QAAQ,GAAG,iBAAO,CAAC,UAAU,CAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;yBACrD;wBAED,qBAAM,aAAK,CAAC,aAAa,CAAE,QAAQ,EAAE,QAAQ,CAAC,EAAA;;wBAA9C,SAA8C,CAAC;;;;;KAC/C;IACF,iBAAC;AAAD,CAAC,AAvND,IAuNC;AAvNY,gCAAU"}
|
package/build/src/HotCLI.d.ts
CHANGED
|
@@ -59,6 +59,10 @@ export declare class HotCLI {
|
|
|
59
59
|
* The build action to execute.
|
|
60
60
|
*/
|
|
61
61
|
onBuildAction: () => Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* The healthcheck action to execute.
|
|
64
|
+
*/
|
|
65
|
+
onHealthcheckAction: () => Promise<void>;
|
|
62
66
|
constructor();
|
|
63
67
|
/**
|
|
64
68
|
* Start the API server.
|
|
@@ -97,6 +101,10 @@ export declare class HotCLI {
|
|
|
97
101
|
* Handle any agent commands.
|
|
98
102
|
*/
|
|
99
103
|
handleAgentCommands(): Promise<commander.Command>;
|
|
104
|
+
/**
|
|
105
|
+
* Handle any healthcheck commands.
|
|
106
|
+
*/
|
|
107
|
+
handleHealthcheckCommands(): Promise<commander.Command>;
|
|
100
108
|
/**
|
|
101
109
|
* Handle any generate commands.
|
|
102
110
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HotCLI.d.ts","sourceRoot":"","sources":["../../src/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,mBAAmB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;;IAqBzC;;OAEG;IACG,cAAc,CAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAC5E,MAAM,EAAE,MAAM,EAAE,wBAAwB,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IA6E/E;;OAEG;IACH,eAAe,CAAE,GAAG,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;KAAE;IAe9D;;OAEG;IACG,mBAAmB,IAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAyFxD;;OAEG;IACG,oBAAoB,IAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAsJzD;;OAEG;IACH,QAAQ,CAAE,SAAS,EAAE,OAAO,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KAAE;IA8B7D;;;;;;OAMG;IACG,iBAAiB,CAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAyvBrE;;OAEG;IACG,mBAAmB,IAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAmFxD;;OAEG;IACG,yBAAyB,IAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAiE9D;;OAEG;IACG,sBAAsB,IAAK,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAsF3D;;OAEG;IACG,KAAK,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAoL3C;;OAEG;IACG,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;CAoB7B"}
|
package/build/src/HotCLI.js
CHANGED
|
@@ -54,12 +54,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
54
54
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
58
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59
|
+
};
|
|
57
60
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
61
|
exports.HotCLI = void 0;
|
|
59
62
|
var ppath = __importStar(require("path"));
|
|
60
63
|
var fs = __importStar(require("fs"));
|
|
61
64
|
var dotenv = __importStar(require("dotenv"));
|
|
62
65
|
var commander = __importStar(require("commander"));
|
|
66
|
+
var node_fetch_1 = __importDefault(require("node-fetch"));
|
|
63
67
|
var HotStaq_1 = require("./HotStaq");
|
|
64
68
|
var HotHTTPServer_1 = require("./HotHTTPServer");
|
|
65
69
|
var HotLog_1 = require("./HotLog");
|
|
@@ -253,10 +257,6 @@ var HotCLI = /** @class */ (function () {
|
|
|
253
257
|
createHotBuilder();
|
|
254
258
|
builder.appendReadMe = true;
|
|
255
259
|
});
|
|
256
|
-
buildCmd.option("--docker-compose", "Build the docker compose file from the given HotSite.json.", function (arg, previous) {
|
|
257
|
-
createHotBuilder();
|
|
258
|
-
builder.dockerCompose = true;
|
|
259
|
-
});
|
|
260
260
|
/*buildCmd.option ("--helm-chart", "Build a Kubernetes Helm Chart from the given HotSite.json.",
|
|
261
261
|
(arg: string, previous: any) =>
|
|
262
262
|
{
|
|
@@ -1050,6 +1050,71 @@ var HotCLI = /** @class */ (function () {
|
|
|
1050
1050
|
});
|
|
1051
1051
|
});
|
|
1052
1052
|
};
|
|
1053
|
+
/**
|
|
1054
|
+
* Handle any healthcheck commands.
|
|
1055
|
+
*/
|
|
1056
|
+
HotCLI.prototype.handleHealthcheckCommands = function () {
|
|
1057
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1058
|
+
var timeout, outputResult, healthcheckCmd;
|
|
1059
|
+
var _this = this;
|
|
1060
|
+
return __generator(this, function (_a) {
|
|
1061
|
+
timeout = 10000;
|
|
1062
|
+
outputResult = true;
|
|
1063
|
+
healthcheckCmd = new commander.Command("healthcheck");
|
|
1064
|
+
healthcheckCmd.description("Execute a healthcheck. Will exit with error code 1 if an HTTP status other than 200 returns.");
|
|
1065
|
+
healthcheckCmd.arguments("<url>");
|
|
1066
|
+
healthcheckCmd.action(function (url, cmdr) {
|
|
1067
|
+
_this.onHealthcheckAction = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1068
|
+
var controller_1, signalTimeout, res, text, ex_1;
|
|
1069
|
+
var _this = this;
|
|
1070
|
+
return __generator(this, function (_a) {
|
|
1071
|
+
switch (_a.label) {
|
|
1072
|
+
case 0:
|
|
1073
|
+
_a.trys.push([0, 3, , 4]);
|
|
1074
|
+
controller_1 = new AbortController();
|
|
1075
|
+
signalTimeout = setTimeout(function () {
|
|
1076
|
+
_this.processor.logger.error("Error: Timeout");
|
|
1077
|
+
controller_1.abort();
|
|
1078
|
+
process.exit(1);
|
|
1079
|
+
}, timeout);
|
|
1080
|
+
this.processor.logger.verbose("Starting healthcheck at ".concat(url));
|
|
1081
|
+
return [4 /*yield*/, (0, node_fetch_1.default)(url, {
|
|
1082
|
+
"signal": controller_1.signal
|
|
1083
|
+
})];
|
|
1084
|
+
case 1:
|
|
1085
|
+
res = _a.sent();
|
|
1086
|
+
clearTimeout(signalTimeout);
|
|
1087
|
+
if (res.status !== 200) {
|
|
1088
|
+
this.processor.logger.error("Error: Received ".concat(res.status));
|
|
1089
|
+
process.exit(1);
|
|
1090
|
+
}
|
|
1091
|
+
return [4 /*yield*/, res.text()];
|
|
1092
|
+
case 2:
|
|
1093
|
+
text = _a.sent();
|
|
1094
|
+
if (outputResult === true)
|
|
1095
|
+
this.processor.logger.info(text);
|
|
1096
|
+
process.exit(0);
|
|
1097
|
+
return [3 /*break*/, 4];
|
|
1098
|
+
case 3:
|
|
1099
|
+
ex_1 = _a.sent();
|
|
1100
|
+
this.processor.logger.error("Error: ".concat(ex_1.message));
|
|
1101
|
+
process.exit(1);
|
|
1102
|
+
return [3 /*break*/, 4];
|
|
1103
|
+
case 4: return [2 /*return*/];
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
}); };
|
|
1107
|
+
});
|
|
1108
|
+
healthcheckCmd.option("--timeout <value>", "The number of milliseconds before timing out.", function (value, previous) {
|
|
1109
|
+
timeout = parseInt(value);
|
|
1110
|
+
});
|
|
1111
|
+
healthcheckCmd.option("--dont-output-result", "If set to true, the output from the url healthcheck will not output.", function (value, previous) {
|
|
1112
|
+
outputResult = false;
|
|
1113
|
+
});
|
|
1114
|
+
return [2 /*return*/, (healthcheckCmd)];
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
};
|
|
1053
1118
|
/**
|
|
1054
1119
|
* Handle any generate commands.
|
|
1055
1120
|
*/
|
|
@@ -1140,12 +1205,12 @@ var HotCLI = /** @class */ (function () {
|
|
|
1140
1205
|
*/
|
|
1141
1206
|
HotCLI.prototype.setup = function (args) {
|
|
1142
1207
|
return __awaiter(this, void 0, void 0, function () {
|
|
1143
|
-
var packageJSON, logLevel, envPath_1, program, command, hotsiteExists, foundHotsitePath, createCmd, runCmd, buildCmd, generateCmd, agentCmd, content, envVars, key, value,
|
|
1208
|
+
var packageJSON, logLevel, envPath_1, program, command, hotsiteExists, foundHotsitePath, createCmd, runCmd, buildCmd, generateCmd, agentCmd, healthcheckCmd, content, envVars, key, value, ex_2;
|
|
1144
1209
|
var _this = this;
|
|
1145
1210
|
return __generator(this, function (_a) {
|
|
1146
1211
|
switch (_a.label) {
|
|
1147
1212
|
case 0:
|
|
1148
|
-
_a.trys.push([0,
|
|
1213
|
+
_a.trys.push([0, 19, , 20]);
|
|
1149
1214
|
return [4 /*yield*/, HotIO_1.HotIO.exists(this.packagePath)];
|
|
1150
1215
|
case 1:
|
|
1151
1216
|
if (!((_a.sent()) === false)) return [3 /*break*/, 3];
|
|
@@ -1264,11 +1329,15 @@ var HotCLI = /** @class */ (function () {
|
|
|
1264
1329
|
case 14:
|
|
1265
1330
|
agentCmd = _a.sent();
|
|
1266
1331
|
command.addCommand(agentCmd);
|
|
1267
|
-
return [4 /*yield*/,
|
|
1332
|
+
return [4 /*yield*/, this.handleHealthcheckCommands()];
|
|
1268
1333
|
case 15:
|
|
1269
|
-
|
|
1270
|
-
|
|
1334
|
+
healthcheckCmd = _a.sent();
|
|
1335
|
+
command.addCommand(healthcheckCmd);
|
|
1336
|
+
return [4 /*yield*/, HotIO_1.HotIO.exists(envPath_1)];
|
|
1271
1337
|
case 16:
|
|
1338
|
+
if (!((_a.sent()) === true)) return [3 /*break*/, 18];
|
|
1339
|
+
return [4 /*yield*/, HotIO_1.HotIO.readTextFile(envPath_1)];
|
|
1340
|
+
case 17:
|
|
1272
1341
|
content = _a.sent();
|
|
1273
1342
|
envVars = dotenv.parse(content);
|
|
1274
1343
|
for (key in envVars) {
|
|
@@ -1276,16 +1345,18 @@ var HotCLI = /** @class */ (function () {
|
|
|
1276
1345
|
if (value != null)
|
|
1277
1346
|
process.env[key] = value;
|
|
1278
1347
|
}
|
|
1279
|
-
_a.label =
|
|
1280
|
-
case
|
|
1348
|
+
_a.label = 18;
|
|
1349
|
+
case 18:
|
|
1281
1350
|
if (args.length > 2)
|
|
1282
1351
|
program.parse(args);
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1352
|
+
if (this.globalLogLevel != null)
|
|
1353
|
+
this.processor.logger.logLevel = this.globalLogLevel;
|
|
1354
|
+
return [3 /*break*/, 20];
|
|
1355
|
+
case 19:
|
|
1356
|
+
ex_2 = _a.sent();
|
|
1357
|
+
this.processor.logger.error(ex_2.stack);
|
|
1358
|
+
return [3 /*break*/, 20];
|
|
1359
|
+
case 20: return [2 /*return*/];
|
|
1289
1360
|
}
|
|
1290
1361
|
});
|
|
1291
1362
|
});
|
|
@@ -1327,7 +1398,13 @@ var HotCLI = /** @class */ (function () {
|
|
|
1327
1398
|
case 9:
|
|
1328
1399
|
_a.sent();
|
|
1329
1400
|
_a.label = 10;
|
|
1330
|
-
case 10:
|
|
1401
|
+
case 10:
|
|
1402
|
+
if (!(this.onHealthcheckAction != null)) return [3 /*break*/, 12];
|
|
1403
|
+
return [4 /*yield*/, this.onHealthcheckAction()];
|
|
1404
|
+
case 11:
|
|
1405
|
+
_a.sent();
|
|
1406
|
+
_a.label = 12;
|
|
1407
|
+
case 12: return [2 /*return*/];
|
|
1331
1408
|
}
|
|
1332
1409
|
});
|
|
1333
1410
|
});
|