querysub 0.711.0 → 0.712.0
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/package.json
CHANGED
|
@@ -102,8 +102,8 @@ export class ServicesListPage extends qreact.Component {
|
|
|
102
102
|
parameters: {
|
|
103
103
|
key: newServiceId,
|
|
104
104
|
machineIds: [],
|
|
105
|
-
repoUrl: gitInfo
|
|
106
|
-
gitRef: gitInfo
|
|
105
|
+
repoUrl: gitInfo?.repoUrl || "",
|
|
106
|
+
gitRef: gitInfo?.latestRef || "",
|
|
107
107
|
command: "ping 1.1.1.1",
|
|
108
108
|
deploy: false,
|
|
109
109
|
overlapTime: DEFAULT_OVERLAP_TIME,
|
|
@@ -32,7 +32,7 @@ async function main() {
|
|
|
32
32
|
let controller = new MachineServiceControllerBase();
|
|
33
33
|
let commitMessage = `emergency update ${formatDateTime(Date.now())}`;
|
|
34
34
|
|
|
35
|
-
let gitInfo = await controller
|
|
35
|
+
let gitInfo = await getGitInfoAssert(controller);
|
|
36
36
|
console.log(magenta(`Starting emergency update of ${gitInfo.repoUrl}`), {
|
|
37
37
|
commitMessage,
|
|
38
38
|
querysubUncommittedFiles: gitInfo.querysubUncommitted.length,
|
|
@@ -47,7 +47,7 @@ async function main() {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// Re-read, as publishing querysub updates our package.json, which then needs to be committed here
|
|
50
|
-
gitInfo = await controller
|
|
50
|
+
gitInfo = await getGitInfoAssert(controller);
|
|
51
51
|
if (gitInfo.uncommitted.length > 0) {
|
|
52
52
|
console.log(magenta(`Committing and pushing the service repo (${gitInfo.uncommitted.length} files changed)`));
|
|
53
53
|
await controller.commitPushService(commitMessage);
|
|
@@ -56,7 +56,7 @@ async function main() {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// Re-read, as latestRef must include the commit we just pushed
|
|
59
|
-
gitInfo = await controller
|
|
59
|
+
gitInfo = await getGitInfoAssert(controller);
|
|
60
60
|
|
|
61
61
|
let serviceIds = await controller.getServiceList();
|
|
62
62
|
let configs: ServiceConfig[] = [];
|
|
@@ -92,4 +92,12 @@ async function main() {
|
|
|
92
92
|
console.log(green(`Archives initialized`));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
async function getGitInfoAssert(controller: MachineServiceControllerBase) {
|
|
96
|
+
let gitInfo = await controller.getGitInfo();
|
|
97
|
+
if (!gitInfo) {
|
|
98
|
+
throw new Error(`Expected git info for the emergency update, but getGitInfo returned undefined because this process is public (isPublic() is true). Run the emergency update without --public, from the repo you deploy from.`);
|
|
99
|
+
}
|
|
100
|
+
return gitInfo;
|
|
101
|
+
}
|
|
102
|
+
|
|
95
103
|
main().catch(logErrors).finally(() => process.exit());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNodeTrue, list, timeInDay, timeInMinute, timeInSecond } from "socket-function/src/misc";
|
|
2
2
|
import { getArchives2 } from "../-a-archives/archives2";
|
|
3
|
-
import { getDomain } from "../config";
|
|
3
|
+
import { getDomain, isPublic } from "../config";
|
|
4
4
|
import { archiveJSONT } from "../-a-archives/archivesJSONT";
|
|
5
5
|
import { SocketFunction } from "socket-function/SocketFunction";
|
|
6
6
|
import { assertIsManagementUser } from "../diagnostics/managementPages";
|
|
@@ -442,6 +442,7 @@ export class MachineServiceControllerBase {
|
|
|
442
442
|
return extractType(module, "ServiceConfig");
|
|
443
443
|
}
|
|
444
444
|
public async getGitInfo() {
|
|
445
|
+
if (isPublic()) return undefined;
|
|
445
446
|
let repoUrl = await getGitURLLive();
|
|
446
447
|
let uncommitted = await getGitUncommitted(".");
|
|
447
448
|
let latestRef = await getLatestRefOnUpstreamBranch(".");
|