pr feedback
parent
a99defafbc
commit
9bfb4dff07
|
|
@ -5538,31 +5538,30 @@ class RemoteClient {
|
|||
lines[0] = lingeringLine + lines[0];
|
||||
lingeringLine = lines.pop() || '';
|
||||
for (const element of lines) {
|
||||
// For K8s, write to both log file and stdout so kubectl logs can capture it
|
||||
// Always write to log file so output can be collected by providers
|
||||
if (element.trim()) {
|
||||
node_fs_1.default.appendFileSync(logFile, `${element}\n`);
|
||||
}
|
||||
// For K8s, also write to stdout so kubectl logs can capture it
|
||||
if (cloud_runner_options_1.default.providerStrategy === 'k8s') {
|
||||
node_fs_1.default.appendFileSync(logFile, element);
|
||||
// Write to stdout so kubectl logs can capture it - ensure newline is included
|
||||
// Stdout flushes automatically on newline, so no explicit flush needed
|
||||
process.stdout.write(`${element}\n`);
|
||||
cloud_runner_logger_1.default.log(element);
|
||||
}
|
||||
else {
|
||||
cloud_runner_logger_1.default.log(element);
|
||||
}
|
||||
cloud_runner_logger_1.default.log(element);
|
||||
}
|
||||
});
|
||||
process.stdin.on('end', () => {
|
||||
if (cloud_runner_options_1.default.providerStrategy === 'k8s') {
|
||||
if (lingeringLine) {
|
||||
node_fs_1.default.appendFileSync(logFile, lingeringLine);
|
||||
if (lingeringLine) {
|
||||
// Always write to log file so output can be collected by providers
|
||||
node_fs_1.default.appendFileSync(logFile, `${lingeringLine}\n`);
|
||||
// For K8s, also write to stdout so kubectl logs can capture it
|
||||
if (cloud_runner_options_1.default.providerStrategy === 'k8s') {
|
||||
// Stdout flushes automatically on newline
|
||||
process.stdout.write(`${lingeringLine}\n`);
|
||||
}
|
||||
cloud_runner_logger_1.default.log(lingeringLine);
|
||||
}
|
||||
else {
|
||||
cloud_runner_logger_1.default.log(lingeringLine);
|
||||
}
|
||||
cloud_runner_logger_1.default.log(lingeringLine);
|
||||
});
|
||||
}
|
||||
static async remoteClientPostBuild() {
|
||||
|
|
@ -7461,7 +7460,8 @@ echo "CACHE_KEY=$CACHE_KEY"`;
|
|||
if ! command -v npm > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/npm && chmod +x /usr/local/bin/npm; fi
|
||||
if ! command -v n > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/n && chmod +x /usr/local/bin/n; fi
|
||||
if ! command -v yarn > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/yarn && chmod +x /usr/local/bin/yarn; fi
|
||||
echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh
|
||||
# Pipe entrypoint.sh output through log stream to capture Unity build output (including "Build succeeded")
|
||||
{ echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh; } | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||
mkdir -p "/data/cache/$CACHE_KEY/Library"
|
||||
if [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar.lz4" ]; then
|
||||
tar -cf "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar"
|
||||
|
|
@ -7469,14 +7469,16 @@ echo "CACHE_KEY=$CACHE_KEY"`;
|
|||
if [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar.lz4" ]; then
|
||||
tar -cf "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar"
|
||||
fi
|
||||
# Run post-build tasks - ensure output is captured even if command fails
|
||||
node ${builderPath} -m remote-cli-post-build || echo "Post-build command completed with warnings"
|
||||
# Run post-build tasks and pipe output through log stream to capture "Activation successful"
|
||||
node ${builderPath} -m remote-cli-post-build | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "Post-build command completed with warnings"
|
||||
# Write end marker and pipe through log stream
|
||||
echo "end of cloud runner job" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||
echo "---${cloud_runner_1.default.buildParameters.logId}" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||
# Mirror cache back into workspace for test assertions
|
||||
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/Library"
|
||||
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build"
|
||||
cp -a "/data/cache/$CACHE_KEY/Library/." "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/Library/" || true
|
||||
cp -a "/data/cache/$CACHE_KEY/build/." "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build/" || true
|
||||
echo "end of cloud runner job"`;
|
||||
cp -a "/data/cache/$CACHE_KEY/build/." "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build/" || true`;
|
||||
}
|
||||
// prettier-ignore
|
||||
return `
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -46,32 +46,35 @@ export class RemoteClient {
|
|||
lingeringLine = lines.pop() || '';
|
||||
|
||||
for (const element of lines) {
|
||||
// For K8s, write to both log file and stdout so kubectl logs can capture it
|
||||
if (CloudRunnerOptions.providerStrategy === 'k8s') {
|
||||
fs.appendFileSync(logFile, element);
|
||||
// Always write to log file so output can be collected by providers
|
||||
if (element.trim()) {
|
||||
fs.appendFileSync(logFile, `${element}\n`);
|
||||
}
|
||||
|
||||
// For K8s, also write to stdout so kubectl logs can capture it
|
||||
if (CloudRunnerOptions.providerStrategy === 'k8s') {
|
||||
// Write to stdout so kubectl logs can capture it - ensure newline is included
|
||||
// Stdout flushes automatically on newline, so no explicit flush needed
|
||||
process.stdout.write(`${element}\n`);
|
||||
CloudRunnerLogger.log(element);
|
||||
} else {
|
||||
CloudRunnerLogger.log(element);
|
||||
}
|
||||
|
||||
CloudRunnerLogger.log(element);
|
||||
}
|
||||
});
|
||||
|
||||
process.stdin.on('end', () => {
|
||||
if (CloudRunnerOptions.providerStrategy === 'k8s') {
|
||||
if (lingeringLine) {
|
||||
fs.appendFileSync(logFile, lingeringLine);
|
||||
if (lingeringLine) {
|
||||
// Always write to log file so output can be collected by providers
|
||||
fs.appendFileSync(logFile, `${lingeringLine}\n`);
|
||||
|
||||
// For K8s, also write to stdout so kubectl logs can capture it
|
||||
if (CloudRunnerOptions.providerStrategy === 'k8s') {
|
||||
// Stdout flushes automatically on newline
|
||||
process.stdout.write(`${lingeringLine}\n`);
|
||||
}
|
||||
CloudRunnerLogger.log(lingeringLine);
|
||||
} else {
|
||||
CloudRunnerLogger.log(lingeringLine);
|
||||
}
|
||||
|
||||
CloudRunnerLogger.log(lingeringLine);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,8 @@ echo "CACHE_KEY=$CACHE_KEY"`;
|
|||
if ! command -v npm > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/npm && chmod +x /usr/local/bin/npm; fi
|
||||
if ! command -v n > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/n && chmod +x /usr/local/bin/n; fi
|
||||
if ! command -v yarn > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/yarn && chmod +x /usr/local/bin/yarn; fi
|
||||
echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh
|
||||
# Pipe entrypoint.sh output through log stream to capture Unity build output (including "Build succeeded")
|
||||
{ echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh; } | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||
mkdir -p "/data/cache/$CACHE_KEY/Library"
|
||||
if [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar.lz4" ]; then
|
||||
tar -cf "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar"
|
||||
|
|
@ -176,14 +177,16 @@ echo "CACHE_KEY=$CACHE_KEY"`;
|
|||
if [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar.lz4" ]; then
|
||||
tar -cf "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar"
|
||||
fi
|
||||
# Run post-build tasks - ensure output is captured even if command fails
|
||||
node ${builderPath} -m remote-cli-post-build || echo "Post-build command completed with warnings"
|
||||
# Run post-build tasks and pipe output through log stream to capture "Activation successful"
|
||||
node ${builderPath} -m remote-cli-post-build | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "Post-build command completed with warnings"
|
||||
# Write end marker and pipe through log stream
|
||||
echo "end of cloud runner job" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||
echo "---${CloudRunner.buildParameters.logId}" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||
# Mirror cache back into workspace for test assertions
|
||||
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/Library"
|
||||
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build"
|
||||
cp -a "/data/cache/$CACHE_KEY/Library/." "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/Library/" || true
|
||||
cp -a "/data/cache/$CACHE_KEY/build/." "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build/" || true
|
||||
echo "end of cloud runner job"`;
|
||||
cp -a "/data/cache/$CACHE_KEY/build/." "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build/" || true`;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
|
|
|
|||
Loading…
Reference in New Issue