Skip to content

Commit 97e6ec7

Browse files
authoredMar 1, 2023
Merge pull request #11131 from CesiumGS/release-deployment
Fix release publish step
2 parents f06252a + 37ad09d commit 97e6ec7

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed
 

‎gulpfile.js

+26-23
Original file line numberDiff line numberDiff line change
@@ -1088,29 +1088,32 @@ async function deployCesiumRelease(bucketName, s3Client, errors) {
10881088
`Cesium version ${release.tag} up to date. Skipping release deployment.`
10891089
);
10901090
} catch (error) {
1091-
// The current version is not uploaded
1092-
if (error.code === "NotFound") {
1093-
console.log("Updating cesium version...");
1094-
const data = await download(release.url);
1095-
// upload and unzip contents
1096-
const key = posix.join(releaseDir, release.tag, "cesium.zip");
1097-
await uploadObject(bucketName, s3Client, key, data, quiet);
1098-
const files = await decompress(data);
1099-
const limit = pLimit(5);
1100-
return Promise.all(
1101-
files.map((file) => {
1102-
return limit(() => {
1103-
if (file.path.startsWith("Apps")) {
1104-
// skip uploading apps and sandcastle
1105-
return;
1106-
}
1107-
1108-
// Upload to release directory
1109-
const key = posix.join(releaseDir, release.tag, file.path);
1110-
return uploadObject(bucketName, s3Client, key, file.data, quiet);
1111-
});
1112-
})
1113-
);
1091+
if (error.$metadata) {
1092+
const { httpStatusCode } = error.$metadata;
1093+
// The current version is not uploaded
1094+
if (httpStatusCode === 404) {
1095+
console.log("Updating cesium version...");
1096+
const data = await download(release.url);
1097+
// upload and unzip contents
1098+
const key = posix.join(releaseDir, release.tag, "cesium.zip");
1099+
await uploadObject(bucketName, s3Client, key, data, quiet);
1100+
const files = await decompress(data);
1101+
const limit = pLimit(5);
1102+
return Promise.all(
1103+
files.map((file) => {
1104+
return limit(async () => {
1105+
if (file.path.startsWith("Apps")) {
1106+
// skip uploading apps and sandcastle
1107+
return;
1108+
}
1109+
1110+
// Upload to release directory
1111+
const key = posix.join(releaseDir, release.tag, file.path);
1112+
return uploadObject(bucketName, s3Client, key, file.data, quiet);
1113+
});
1114+
})
1115+
);
1116+
}
11141117
}
11151118

11161119
// else, unexpected error

0 commit comments

Comments
 (0)
Please sign in to comment.