log file path

This commit is contained in:
Frostebite 2023-05-14 21:46:09 +01:00
parent d0934cbc2a
commit 8e5ccae56c
4 changed files with 21 additions and 23 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -23,24 +23,6 @@ export class RemoteClient {
await RemoteClient.replaceLargePackageReferencesWithSharedReferences(); await RemoteClient.replaceLargePackageReferencesWithSharedReferences();
await RemoteClient.runCustomHookFiles(`before-build`); await RemoteClient.runCustomHookFiles(`before-build`);
} }
@CliFunction(`remote-cli-build`, `sets up a repository, usually before a game-ci build`)
static async remoteClientBuild() {
CloudRunnerLogger.log(`bootstrap game ci cloud runner...`);
const distFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist');
const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
CloudRunnerSystem.Run(`mkdir -p ${`${CloudRunnerFolders.ToLinuxFolder(
CloudRunnerFolders.projectBuildFolderAbsolute,
)}/build`}
cd ${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.projectPathAbsolute)}
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(distFolder, 'default-build-script'))}" "/UnityBuilderAction"
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'entrypoint.sh'))}" "/entrypoint.sh"
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'steps'))}" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
echo "game ci start"
/entrypoint.sh
echo "game ci caching results"`);
}
@CliFunction(`remote-cli-post-build`, `runs a cloud runner build`) @CliFunction(`remote-cli-post-build`, `runs a cloud runner build`)
public static async remoteClientPostBuild(): Promise<string> { public static async remoteClientPostBuild(): Promise<string> {

View File

@ -69,12 +69,9 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
export GITHUB_WORKSPACE="${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute)}" export GITHUB_WORKSPACE="${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.repoPathAbsolute)}"
df -H /data/ df -H /data/
${BuildAutomationWorkflow.setupCommands(builderPath)} ${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) || ' '} ${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} ${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
node ${builderPath} -m remote-cli-build ${BuildAutomationWorkflow.BuildCommands(builderPath)}
node ${builderPath} -m remote-cli-post-build
${buildHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}`; ${buildHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}`;
} }
@ -94,6 +91,25 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
}; else ${commands} ; fi`; }; else ${commands} ; fi`;
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
${cloneBuilderCommands}`; ${cloneBuilderCommands}
echo "log start" > /home/job-log.txt
node ${builderPath} -m remote-cli-pre-build`;
}
private static BuildCommands(builderPath: string) {
const distFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist');
const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
return `echo "game ci cloud runner initalized"
mkdir -p ${`${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.projectBuildFolderAbsolute)}/build`}
cd ${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.projectPathAbsolute)}
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(distFolder, 'default-build-script'))}" "/UnityBuilderAction"
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'entrypoint.sh'))}" "/entrypoint.sh"
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'steps'))}" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
echo "game ci start" > /home/job-log.txt
/entrypoint.sh > /home/job-log.txt
node ${builderPath} -m remote-cli-post-build`;
} }
} }