Improve remote runtime cache logging
This commit is contained in:
@@ -53,6 +53,13 @@ export interface IRemoteEphemeralRuntimeCacheCheckOptions {
|
||||
nodePath?: string;
|
||||
}
|
||||
|
||||
export interface IRemoteEphemeralRuntimeMarkOptions {
|
||||
runtimeRoot: string;
|
||||
runtimeSha256: string;
|
||||
markerFileName?: string;
|
||||
nodePath?: string;
|
||||
}
|
||||
|
||||
export const defaultIdeDataRoot = '~/.git.zone/ide';
|
||||
export const defaultInstallRoot = '~/.git.zone/ide/server';
|
||||
export const remoteEphemeralRuntimeMarkerFileName = '.gitzone-runtime-sha256';
|
||||
@@ -209,6 +216,23 @@ export const createRemoteEphemeralRuntimeCacheCheckCommand = (options: IRemoteEp
|
||||
].join('\n');
|
||||
};
|
||||
|
||||
export const createRemoteEphemeralRuntimeMarkCommand = (options: IRemoteEphemeralRuntimeMarkOptions) => {
|
||||
const markerFileName = options.markerFileName ?? remoteEphemeralRuntimeMarkerFileName;
|
||||
const markerPath = joinRemotePath(options.runtimeRoot, markerFileName);
|
||||
const markerTempPath = `${markerPath}.tmp`;
|
||||
const nodePath = options.nodePath ?? joinRemotePath(options.runtimeRoot, 'node/bin/node');
|
||||
const backendPath = joinRemotePath(options.runtimeRoot, 'applications/remote-theia/lib/backend/main.js');
|
||||
|
||||
return [
|
||||
'set -euo pipefail',
|
||||
`test -x ${quoteRemotePath(nodePath)}`,
|
||||
`test -f ${quoteRemotePath(backendPath)}`,
|
||||
`printf '%s\n' ${quoteShellArg(options.runtimeSha256)} > ${quoteRemotePath(markerTempPath)}`,
|
||||
`mv ${quoteRemotePath(markerTempPath)} ${quoteRemotePath(markerPath)}`,
|
||||
`printf 'runtimeCache=stored\n'`,
|
||||
].join('\n');
|
||||
};
|
||||
|
||||
export const createRemoteHealthCommand = (serverVersion: string, installRoot = defaultInstallRoot) => {
|
||||
const plan = createRemoteServerInstallPlan({
|
||||
serverVersion,
|
||||
|
||||
Reference in New Issue
Block a user