fix: garbage collect not implemented error

pull/437/head
Frostebite 2022-10-21 17:43:48 +01:00
parent 8cb640b28c
commit 2eef9cca67
3 changed files with 19 additions and 1 deletions

7
dist/index.js vendored
View File

@ -2800,6 +2800,8 @@ const fs_1 = __nccwpck_require__(57147);
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144)); const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
const cloud_runner_system_1 = __nccwpck_require__(99393); const cloud_runner_system_1 = __nccwpck_require__(99393);
const fs = __importStar(__nccwpck_require__(57147)); const fs = __importStar(__nccwpck_require__(57147));
const cloud_runner_folders_1 = __nccwpck_require__(13527);
const path_1 = __importDefault(__nccwpck_require__(71017));
class LocalDockerCloudRunner { class LocalDockerCloudRunner {
listResources() { listResources() {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
@ -2846,6 +2848,7 @@ class LocalDockerCloudRunner {
this.buildParameters = buildParameters; this.buildParameters = buildParameters;
} }
runTaskInWorkflow(buildGuid, image, commands, mountdir, workingdir, environment, secrets) { runTaskInWorkflow(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {
var _a;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
cloud_runner_logger_1.default.log(buildGuid); cloud_runner_logger_1.default.log(buildGuid);
cloud_runner_logger_1.default.log(commands); cloud_runner_logger_1.default.log(commands);
@ -2900,6 +2903,10 @@ cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
}, },
}, },
}, true); }, true);
if (!((_a = this.buildParameters) === null || _a === void 0 ? void 0 : _a.retainWorkspace) &&
fs.existsSync(`${workspace}/cloud-runner-cache/${path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}`)) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`rm -r ${workspace}/cloud-runner-cache/${path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}`);
}
return myOutput; return myOutput;
}); });
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -144,6 +144,17 @@ cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
true, true,
); );
if (
!this.buildParameters?.retainWorkspace &&
fs.existsSync(
`${workspace}/cloud-runner-cache/${path.basename(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}`,
)
) {
await CloudRunnerSystem.Run(
`rm -r ${workspace}/cloud-runner-cache/${path.basename(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}`,
);
}
return myOutput; return myOutput;
} }
} }