log file path

pull/531/head
Frostebite 2023-05-14 21:00:49 +01:00
parent d3b4f28e32
commit d0934cbc2a
4 changed files with 13 additions and 22 deletions

16
dist/index.js generated vendored
View File

@ -4496,7 +4496,7 @@ class RemoteClientLogger {
}
static appendToFile(message) {
if (cloud_runner_1.default.isCloudRunnerEnvironment) {
node_fs_1.default.appendFileSync(RemoteClientLogger.LogFilePath, message);
node_fs_1.default.appendFileSync(RemoteClientLogger.LogFilePath, `${message}\n`);
}
}
static printCollectedLogs() {
@ -5699,23 +5699,19 @@ class BuildAutomationWorkflow {
export GITHUB_WORKSPACE="${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}"
df -H /data/
${BuildAutomationWorkflow.setupCommands(builderPath)}
echo "log start" > /home/job-log.txt
node ${builderPath} -m remote-cli-pre-build
${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${BuildAutomationWorkflow.BuildCommands(builderPath)}
node ${builderPath} -m remote-cli-build
node ${builderPath} -m remote-cli-post-build
${buildHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}`;
}
static setupCommands(builderPath) {
const commands = `mkdir -p ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute)} && git clone -q -b ${cloud_runner_1.default.buildParameters.cloudRunnerBranch} ${cloud_runner_folders_1.CloudRunnerFolders.unityBuilderRepoUrl} "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute)}" && chmod +x ${builderPath}`;
const cloneBuilderCommands = `if [ -e "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}" ] && [ -e "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, `.git`))}" ] ; then echo "Builder Already Exists!" && tree ${cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute}; else ${commands} ; fi`;
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
${cloneBuilderCommands}
echo "log start" > /home/job-log.txt
node ${builderPath} -m remote-cli-pre-build`;
}
static BuildCommands(builderPath) {
return `echo "game ci cloud runner initalized"
node ${builderPath} -m remote-cli-build
node ${builderPath} -m remote-cli-post-build`;
${cloneBuilderCommands}`;
}
}
exports.BuildAutomationWorkflow = BuildAutomationWorkflow;

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -28,7 +28,7 @@ export class RemoteClientLogger {
public static appendToFile(message: string) {
if (CloudRunner.isCloudRunnerEnvironment) {
fs.appendFileSync(RemoteClientLogger.LogFilePath, message);
fs.appendFileSync(RemoteClientLogger.LogFilePath, `${message}\n`);
}
}

View File

@ -69,9 +69,12 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
export GITHUB_WORKSPACE="${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute)}"
df -H /data/
${BuildAutomationWorkflow.setupCommands(builderPath)}
echo "log start" > /home/job-log.txt
node ${builderPath} -m remote-cli-pre-build
${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${BuildAutomationWorkflow.BuildCommands(builderPath)}
node ${builderPath} -m remote-cli-build
node ${builderPath} -m remote-cli-post-build
${buildHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}`;
}
@ -91,14 +94,6 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
}; else ${commands} ; fi`;
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
${cloneBuilderCommands}
echo "log start" > /home/job-log.txt
node ${builderPath} -m remote-cli-pre-build`;
}
private static BuildCommands(builderPath: string) {
return `echo "game ci cloud runner initalized"
node ${builderPath} -m remote-cli-build
node ${builderPath} -m remote-cli-post-build`;
${cloneBuilderCommands}`;
}
}