Fix s3 command for workspace locking

pull/461/head
Frostebite 2022-09-17 04:25:29 +01:00
parent f72739254b
commit 54eab9797b
3 changed files with 5 additions and 5 deletions

4
dist/index.js vendored
View File

@ -641,14 +641,14 @@ class SharedWorkspaceLocking {
// this job + date
const file = `_lock_${cloud_runner_1.default.buildParameters.buildGuid}_${Date.now()}`;
fs.writeFileSync(file, '');
yield cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 cp ./${file} s3://game-ci-test-storage/locks/${workspace}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 cp ./${file} s3://game-ci-test-storage/locks/${workspace}/${file}`);
fs.rmSync(file);
return SharedWorkspaceLocking.HasWorkspaceLock(workspace);
});
}
static HasWorkspaceLock(workspace) {
return __awaiter(this, void 0, void 0, function* () {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 ls ./game-ci-test-storage/locks/${workspace}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 ls s3://game-ci-test-storage/locks/${workspace}`);
return true;
});
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -23,13 +23,13 @@ export class SharedWorkspaceLocking {
// this job + date
const file = `_lock_${CloudRunner.buildParameters.buildGuid}_${Date.now()}`;
fs.writeFileSync(file, '');
await CloudRunnerSystem.Run(`aws s3 cp ./${file} s3://game-ci-test-storage/locks/${workspace}`);
await CloudRunnerSystem.Run(`aws s3 cp ./${file} s3://game-ci-test-storage/locks/${workspace}/${file}`);
fs.rmSync(file);
return SharedWorkspaceLocking.HasWorkspaceLock(workspace);
}
public static async HasWorkspaceLock(workspace: string): Promise<boolean> {
await CloudRunnerSystem.Run(`aws s3 ls ./game-ci-test-storage/locks/${workspace}`);
await CloudRunnerSystem.Run(`aws s3 ls s3://game-ci-test-storage/locks/${workspace}`);
return true;
}