Fix s3 command for workspace locking
parent
f72739254b
commit
54eab9797b
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue