parameterize s3
parent
6d80dcf9bf
commit
563193a61f
|
|
@ -5537,12 +5537,15 @@ class SharedWorkspaceLocking {
|
|||
}
|
||||
static DoesWorkspaceTopLevelExist(buildParametersContext) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return ((yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`))
|
||||
try {
|
||||
yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`);
|
||||
return (yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`))
|
||||
.map((x) => x.replace(`/`, ``))
|
||||
.includes(`locks`) &&
|
||||
(yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`))
|
||||
.map((x) => x.replace(`/`, ``))
|
||||
.includes(buildParametersContext.cacheKey));
|
||||
.includes(buildParametersContext.cacheKey);
|
||||
}
|
||||
catch (_a) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
static GetAllLocks(workspace, buildParametersContext) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -23,14 +23,15 @@ export class SharedWorkspaceLocking {
|
|||
).map((x) => x.replace(`/`, ``));
|
||||
}
|
||||
public static async DoesWorkspaceTopLevelExist(buildParametersContext: BuildParameters) {
|
||||
return (
|
||||
(await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`))
|
||||
try {
|
||||
await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`);
|
||||
|
||||
return (await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`))
|
||||
.map((x) => x.replace(`/`, ``))
|
||||
.includes(`locks`) &&
|
||||
(await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`))
|
||||
.map((x) => x.replace(`/`, ``))
|
||||
.includes(buildParametersContext.cacheKey)
|
||||
);
|
||||
.includes(buildParametersContext.cacheKey);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static async GetAllLocks(workspace: string, buildParametersContext: BuildParameters): Promise<string[]> {
|
||||
if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue