Cleanup logging

pull/310/head
Frostebite 2021-12-24 04:27:18 +00:00
parent b28e93012b
commit 6d1c63f214
4 changed files with 20 additions and 12 deletions

24
dist/index.js vendored
View File

@ -2060,11 +2060,15 @@ class DownloadRepository {
cloud_runner_logger_1.default.logRemoteCli(cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl); cloud_runner_logger_1.default.logRemoteCli(cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl);
yield run_cli_1.RunCli.RunCli(` yield run_cli_1.RunCli.RunCli(`
git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${cloud_runner_state_1.CloudRunnerState.repoPathFull} git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${cloud_runner_state_1.CloudRunnerState.repoPathFull}
`);
yield run_cli_1.RunCli.RunCli(`
git checkout ${process.env.GITHUB_SHA} git checkout ${process.env.GITHUB_SHA}
`); `);
cloud_runner_logger_1.default.logRemoteCli(`Checked out ${process.env.GITHUB_SHA}`); cloud_runner_logger_1.default.logRemoteCli(`Checked out ${process.env.GITHUB_SHA}`);
yield run_cli_1.RunCli.RunCli(` yield run_cli_1.RunCli.RunCli(`
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
`);
yield run_cli_1.RunCli.RunCli(`
md5sum .lfs-assets-guid > .lfs-assets-guid-sum md5sum .lfs-assets-guid > .lfs-assets-guid-sum
`); `);
const LFS_ASSETS_HASH = fs_1.default.readFileSync(`${path_1.default.join(cloud_runner_state_1.CloudRunnerState.repoPathFull, `.lfs-assets-guid`)}`, 'utf8'); const LFS_ASSETS_HASH = fs_1.default.readFileSync(`${path_1.default.join(cloud_runner_state_1.CloudRunnerState.repoPathFull, `.lfs-assets-guid`)}`, 'utf8');
@ -2657,20 +2661,20 @@ class DownloadStep {
try { try {
cloud_runner_logger_1.default.logLine('Starting step 1/2 download game files from repository, try to use cache'); cloud_runner_logger_1.default.logLine('Starting step 1/2 download game files from repository, try to use cache');
yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runBuildTask(cloud_runner_state_1.CloudRunnerState.buildGuid, image, [ yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runBuildTask(cloud_runner_state_1.CloudRunnerState.buildGuid, image, [
` `
apk update -q apk update -q
apk add unzip zip git-lfs jq tree nodejs -q apk add unzip zip git-lfs jq tree nodejs -q
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull} mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull}
echo "${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand}" echo "${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand}"
${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand} ${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand}
chmod +x ${cloud_runner_state_1.CloudRunnerState.builderPathFull}/dist/index.js chmod +x ${cloud_runner_state_1.CloudRunnerState.builderPathFull}/dist/index.js
node ${cloud_runner_state_1.CloudRunnerState.builderPathFull}/dist/index.js -m remote-cli node ${cloud_runner_state_1.CloudRunnerState.builderPathFull}/dist/index.js -m remote-cli
`, `,
], `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets); ], `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets);
} }
catch (error) { catch (error) {
cloud_runner_logger_1.default.logLine(`ENV VARS ${JSON.stringify(environmentVariables)} SECRETS ${JSON.stringify(secrets)}`); cloud_runner_logger_1.default.logLine(`Failed download repository step 1/2`);
throw error; throw error;
} }
}); });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -19,11 +19,15 @@ export class DownloadRepository {
CloudRunnerLogger.logRemoteCli(CloudRunnerState.targetBuildRepoUrl); CloudRunnerLogger.logRemoteCli(CloudRunnerState.targetBuildRepoUrl);
await RunCli.RunCli(` await RunCli.RunCli(`
git clone ${CloudRunnerState.targetBuildRepoUrl} ${CloudRunnerState.repoPathFull} git clone ${CloudRunnerState.targetBuildRepoUrl} ${CloudRunnerState.repoPathFull}
`);
await RunCli.RunCli(`
git checkout ${process.env.GITHUB_SHA} git checkout ${process.env.GITHUB_SHA}
`); `);
CloudRunnerLogger.logRemoteCli(`Checked out ${process.env.GITHUB_SHA}`); CloudRunnerLogger.logRemoteCli(`Checked out ${process.env.GITHUB_SHA}`);
await RunCli.RunCli(` await RunCli.RunCli(`
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
`);
await RunCli.RunCli(`
md5sum .lfs-assets-guid > .lfs-assets-guid-sum md5sum .lfs-assets-guid > .lfs-assets-guid-sum
`); `);
const LFS_ASSETS_HASH = fs.readFileSync(`${path.join(CloudRunnerState.repoPathFull, `.lfs-assets-guid`)}`, 'utf8'); const LFS_ASSETS_HASH = fs.readFileSync(`${path.join(CloudRunnerState.repoPathFull, `.lfs-assets-guid`)}`, 'utf8');

View File

@ -46,7 +46,7 @@ export class DownloadStep implements StepInterface {
secrets, secrets,
); );
} catch (error) { } catch (error) {
CloudRunnerLogger.logLine(`ENV VARS ${JSON.stringify(environmentVariables)} SECRETS ${JSON.stringify(secrets)}`); CloudRunnerLogger.logLine(`Failed download repository step 1/2`);
throw error; throw error;
} }
} }