Skip to content

Commit f5f00f6

Browse files
authored
Merge pull request #666 from TerriaJS/small-improvements
De-duplicate code in gulpfile and fixup helm files
2 parents 95f3905 + 6cac4fa commit f5f00f6

5 files changed

Lines changed: 9 additions & 69 deletions

File tree

deploy/helm/docker-registry.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

deploy/helm/example-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ global:
22
rollingUpdate:
33
maxUnavailable: 1
44
image:
5-
tag: "0.0.6"
5+
tag: "0.1.1"

deploy/helm/kube-registry-proxy.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

deploy/helm/terria/charts/terriamap/values.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
nodePort:
22
image:
3-
#repository: ghcr.io/terriajs
4-
#tag: latest
5-
#full: terrimap:0.0.6
3+
# By default this pulls ghcr.io/terriajs/terrimap:latest
4+
# Set "full" to specify a custom terriamap image to be used
5+
# Or you can set "repository" or "tag" if required
6+
# full: "ghcr.io/terriajs/terriamap:0.1.1"
7+
# repository: ghcr.io/terriajs
8+
# tag: latest
69
pullPolicy: Always
710
clientConfig:
811
initializationUrls:
912
- helm
1013
- terria
1114
parameters:
12-
bingMapsKey: AkaOmRFtjAb71cXgLwAGtLbj2RpkPKtVqAIroFQsocfurCBILxIeAWPkil7hhRy_
1315
disclaimer:
1416
text: "Disclaimer: This map must not be used for navigation or precise spatial analysis"
1517
url: "http://google.com"

gulpfile.js

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var fs = require("fs");
1111
var gulp = require("gulp");
1212
var path = require("path");
1313
var PluginError = require("plugin-error");
14+
var terriajsServerGulpTask = require("terriajs/buildprocess/terriajsServerGulpTask");
1415

1516
var watchOptions = {
1617
interval: 1000
@@ -284,63 +285,7 @@ function checkForDuplicateCesium() {
284285
}
285286
}
286287

287-
gulp.task("terriajs-server", function (done) {
288-
// E.g. gulp terriajs-server --terriajsServerArg port=4000 --terriajsServerArg verbose=true
289-
// or gulp dev --terriajsServerArg port=3000
290-
const { spawn } = require("child_process");
291-
const minimist = require("minimist");
292-
// Arguments written in skewer-case can cause problems (unsure why), so stick to camelCase
293-
const options = minimist(process.argv.slice(2), {
294-
string: ["terriajsServerArg"],
295-
default: { terriajsServerArg: [] }
296-
});
297-
298-
const logFile = fs.openSync("./terriajs-server.log", "w");
299-
const serverArgs = Array.isArray(options.terriajsServerArg)
300-
? options.terriajsServerArg
301-
: [options.terriajsServerArg];
302-
const child = spawn(
303-
"node",
304-
[
305-
require.resolve("terriajs-server/terriajs-server.js"),
306-
...serverArgs.map((arg) => `--${arg}`)
307-
],
308-
{ detached: true, stdio: ["ignore", logFile, logFile] }
309-
);
310-
child.on("exit", (exitCode, signal) => {
311-
done(
312-
new Error(
313-
"terriajs-server quit" +
314-
(exitCode !== null ? ` with exit code: ${exitCode}` : "") +
315-
(signal ? ` from signal: ${signal}` : "") +
316-
"\nCheck terriajs-server.log for more information."
317-
)
318-
);
319-
});
320-
child.on("spawn", () => {
321-
console.log("terriajs-server started - see terriajs-server.log for logs");
322-
});
323-
// Intercept SIGINT, SIGTERM and SIGHUP, cleanup terriajs-server and re-send signal
324-
// May fail to catch some relevant signals on Windows
325-
// SIGINT: ctrl+c
326-
// SIGTERM: kill <pid>
327-
// SIGHUP: terminal closed
328-
process.once("SIGINT", () => {
329-
child.kill("SIGTERM");
330-
process.kill(process.pid, "SIGINT");
331-
});
332-
process.once("SIGTERM", () => {
333-
child.kill("SIGTERM");
334-
process.kill(process.pid, "SIGTERM");
335-
});
336-
process.once("SIGHUP", () => {
337-
child.kill("SIGTERM");
338-
process.kill(process.pid, "SIGHUP");
339-
});
340-
process.on("exit", () => {
341-
child.kill("SIGTERM");
342-
});
343-
});
288+
gulp.task("terriajs-server", terriajsServerGulpTask(3001));
344289

345290
gulp.task("build", gulp.series("copy-terriajs-assets", "build-app"));
346291
gulp.task("release", gulp.series("copy-terriajs-assets", "release-app"));

0 commit comments

Comments
 (0)