Caching cleanup

pull/310/head
Frostebite 2022-01-02 21:30:15 +00:00
parent 3cf63d5ffa
commit 26e4298f41
4 changed files with 11 additions and 15 deletions

11
dist/index.js vendored
View File

@ -811,8 +811,6 @@ const lfs_hashing_1 = __webpack_require__(47011);
const cloud_runner_agent_system_1 = __webpack_require__(87685);
const __1 = __webpack_require__(41359);
const remote_client_logger_1 = __webpack_require__(68972);
const console_1 = __webpack_require__(57082);
const path_1 = __importDefault(__webpack_require__(85622));
class SetupCloudRunnerRepository {
static run() {
return __awaiter(this, void 0, void 0, function* () {
@ -839,12 +837,11 @@ class SetupCloudRunnerRepository {
return __awaiter(this, void 0, void 0, function* () {
try {
remote_client_logger_1.RemoteClientLogger.log(`Initializing source repository for cloning with caching of LFS files`);
process.chdir(path_1.default.join(cloud_runner_state_1.CloudRunnerState.repoPathFull, `..`));
process.chdir(cloud_runner_state_1.CloudRunnerState.repoPathFull);
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git config --global advice.detachedHead false`);
remote_client_logger_1.RemoteClientLogger.log(`Cloning the repository being built:`);
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git lfs install --skip-smudge`);
console_1.assert(!fs_1.default.existsSync(cloud_runner_state_1.CloudRunnerState.repoPathFull));
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${path_1.default.basename(cloud_runner_state_1.CloudRunnerState.repoPathFull)}`);
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl}`);
if (__1.Input.cloudRunnerTests) {
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`ls -lh`);
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree`);
@ -2647,7 +2644,9 @@ class CloudRunnerLogger {
});
}
static Shutdown() {
CloudRunnerLogger.child.kill(0);
if (CloudRunnerLogger.child) {
CloudRunnerLogger.child.kill(0);
}
}
}
CloudRunnerLogger.logsFile = process.env.GCP_LOG_FILE || '';

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,6 @@ import { LFSHashing } from './lfs-hashing';
import { CloudRunnerAgentSystem } from './cloud-runner-agent-system';
import { Input } from '../..';
import { RemoteClientLogger } from './remote-client-logger';
import { assert } from 'console';
import path from 'path';
export class SetupCloudRunnerRepository {
public static async run() {
@ -40,14 +38,11 @@ export class SetupCloudRunnerRepository {
private static async cloneRepoWithoutLFSFiles() {
try {
RemoteClientLogger.log(`Initializing source repository for cloning with caching of LFS files`);
process.chdir(path.join(CloudRunnerState.repoPathFull, `..`));
process.chdir(CloudRunnerState.repoPathFull);
await CloudRunnerAgentSystem.Run(`git config --global advice.detachedHead false`);
RemoteClientLogger.log(`Cloning the repository being built:`);
await CloudRunnerAgentSystem.Run(`git lfs install --skip-smudge`);
assert(!fs.existsSync(CloudRunnerState.repoPathFull));
await CloudRunnerAgentSystem.Run(
`git clone ${CloudRunnerState.targetBuildRepoUrl} ${path.basename(CloudRunnerState.repoPathFull)}`,
);
await CloudRunnerAgentSystem.Run(`git clone ${CloudRunnerState.targetBuildRepoUrl}`);
if (Input.cloudRunnerTests) {
await CloudRunnerAgentSystem.Run(`ls -lh`);
await CloudRunnerAgentSystem.Run(`tree`);

View File

@ -76,7 +76,9 @@ class CloudRunnerLogger {
});
}
public static Shutdown() {
CloudRunnerLogger.child.kill(0);
if (CloudRunnerLogger.child) {
CloudRunnerLogger.child.kill(0);
}
}
private static child: ChildProcess;
}