From fb6ea4017fffc9649ddf52ed40cfc4d4dd5b1332 Mon Sep 17 00:00:00 2001 From: Kevin Mas Ruiz Date: Fri, 25 Aug 2023 14:22:20 +0200 Subject: [PATCH] Revert "chore: group download center packages by platform MONGOSH-1346 (#1609)" This reverts commit 960f621f4564110c9203d68d17e802678b5dd4ac. --- config/release-package-matrix.d.ts | 1 - config/release-package-matrix.js | 68 +++++++------------ package-lock.json | 39 ++++++----- packages/build/package.json | 2 +- packages/build/src/config/build-variant.ts | 12 ---- .../build/src/download-center/config.spec.ts | 58 +++++++--------- packages/build/src/download-center/config.ts | 35 +++------- .../src/packaging/package/get-package-file.ts | 35 ++-------- 8 files changed, 86 insertions(+), 164 deletions(-) diff --git a/config/release-package-matrix.d.ts b/config/release-package-matrix.d.ts index a6dcb0077a..f37e3c8ddc 100644 --- a/config/release-package-matrix.d.ts +++ b/config/release-package-matrix.d.ts @@ -8,7 +8,6 @@ export interface PackageInformation { name: string; description: string; packageOn: string; - packageType: string; smokeTestKind: 'docker' | 'rpmextract' | 'debextract' | 'none'; smokeTestDockerfiles?: string[]; serverLikeTargetList: string[]; diff --git a/config/release-package-matrix.js b/config/release-package-matrix.js index 8523183755..0fa3419aa9 100644 --- a/config/release-package-matrix.js +++ b/config/release-package-matrix.js @@ -8,113 +8,97 @@ const rhel70AndAboveAndRpmBased = ['rhel70', 'rhel71', ...rhel72AndAbove, 'amazo const ubuntu1804AndAboveAndDebBased = ['ubuntu1804', 'ubuntu1804', 'ubuntu2004', 'ubuntu2204', 'debian92', 'debian10', 'debian11', 'debian12'] const allLinux = [...rhel70AndAboveAndRpmBased, ...ubuntu1804AndAboveAndDebBased] -const publicDescriptions = { - darwin_x64: 'MacOS x64 (10.14+)', - darwin_arm64: 'MacOS M1 (11.0+)', - linux_x64: 'Linux x64', - linux_arm64: 'Linux arm64', - debian_x64: 'Debian (10+) / Ubuntu (18.04+) x64', - debian_arm64: 'Debian (10+) / Ubuntu (18.04+) arm64', - rhel_x64: 'RHEL / CentOS (7+) x64', - rhel_arm64: 'RHEL / CentOS (7+) arm64', - linux_ppc64le: 'Linux ppc64le', - rhel_ppc64le: 'RHEL / CentOS (7+) ppc64le', - linux_s390x: 'Linux ppc64le', - rhel_s390x: 'RHEL / CentOS (7+) ppc64le', - win32_x64: 'Windows x64 (8.1+)' -}; - exports.RELEASE_PACKAGE_MATRIX = [ { executableOsId: 'darwin-x64', compileBuildVariant: 'darwin', packages: [ - { name: 'darwin-x64', description: publicDescriptions.darwin_x64, packageType: 'zip', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } + { name: 'darwin-x64', description: 'MacOS 64-bit (10.14+)', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } ] }, { executableOsId: 'darwin-arm64', compileBuildVariant: 'darwin_arm64', packages: [ - { name: 'darwin-arm64', description: publicDescriptions.darwin_arm64, packageType: 'zip', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } + { name: 'darwin-arm64', description: 'MacOS M1 (11.0+)', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } ] }, { executableOsId: 'linux-x64', compileBuildVariant: 'linux_x64_build', packages: [ - { name: 'linux-x64', description: publicDescriptions.linux_x64, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...allLinux] }, - { name: 'deb-x64', description: publicDescriptions.debian_x64, packageType: 'deb', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'ubuntu22.04-nohome-deb', 'debian9-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-x64', description: publicDescriptions.rhel_x64, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'suse12-rpm', 'suse15-rpm', 'amazonlinux1-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } + { name: 'linux-x64', description: 'Linux Tarball 64-bit', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...allLinux] }, + { name: 'deb-x64', description: 'Debian / Ubuntu 64-bit', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'ubuntu22.04-nohome-deb', 'debian9-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-x64', description: 'RHEL / CentOS / Fedora / Suse 64-bit', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'suse12-rpm', 'suse15-rpm', 'amazonlinux1-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } ] }, { executableOsId: 'linux-x64-openssl11', compileBuildVariant: 'linux_x64_build_openssl11', packages: [ - { name: 'linux-x64-openssl11', description: publicDescriptions.linux_x64, packageType: 'tgz with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, - { name: 'deb-x64-openssl11', description: publicDescriptions.debian_x64, packageType: 'deb with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-x64-openssl11', description: publicDescriptions.rhel_x64, packageType: 'rpm with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-epel-rpm', 'amazonlinux2-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } + { name: 'linux-x64-openssl11', description: 'Linux Tarball 64-bit (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, + { name: 'deb-x64-openssl11', description: 'Debian / Ubuntu 64-bit (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-x64-openssl11', description: 'RHEL / CentOS 64-bit (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-epel-rpm', 'amazonlinux2-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } ] }, { executableOsId: 'linux-x64-openssl3', compileBuildVariant: 'linux_x64_build_openssl3', packages: [ - { name: 'linux-x64-openssl3', description: publicDescriptions.linux_x64, packageType: 'tgz with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, - { name: 'deb-x64-openssl3', description: publicDescriptions.debian_x64, packageType: 'deb with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-x64-openssl3', description: publicDescriptions.rhel_x64, packageType: 'rpm with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } + { name: 'linux-x64-openssl3', description: 'Linux Tarball 64-bit (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, + { name: 'deb-x64-openssl3', description: 'Debian / Ubuntu 64-bit (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-x64-openssl3', description: 'RHEL / CentOS 64-bit (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } ] }, { executableOsId: 'linux-arm64', compileBuildVariant: 'linux_arm64_build', packages: [ - { name: 'linux-arm64', description: publicDescriptions.linux_arm64, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...al2AndAbove] }, - { name: 'deb-arm64', description: publicDescriptions.debian_arm64, packageType: 'deb', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-arm64', description: publicDescriptions.rhel_arm64, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } + { name: 'linux-arm64', description: 'Linux Tarball arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...al2AndAbove] }, + { name: 'deb-arm64', description: 'Debian / Ubuntu arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-arm64', description: 'RHEL / CentOS arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } ] }, { executableOsId: 'linux-arm64-openssl11', compileBuildVariant: 'linux_arm64_build_openssl11', packages: [ - { name: 'linux-arm64-openssl11', description: publicDescriptions.linux_arm64, packageType: 'tgz with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, - { name: 'deb-arm64-openssl11', description: publicDescriptions.debian_arm64, packageType: 'deb with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-arm64-openssl11', description: publicDescriptions.rhel_arm64, packageType: 'rpm with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm'], serverLikeTargetList: [...al2AndAbove] } + { name: 'linux-arm64-openssl11', description: 'Linux Tarball arm64 (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, + { name: 'deb-arm64-openssl11', description: 'Debian / Ubuntu arm64 (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-arm64-openssl11', description: 'Redhat / Centos arm64 (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm'], serverLikeTargetList: [...al2AndAbove] } ] }, { executableOsId: 'linux-arm64-openssl3', compileBuildVariant: 'linux_arm64_build_openssl3', packages: [ - { name: 'linux-arm64-openssl3', description: publicDescriptions.linux_arm64, packageType: 'tgz with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, - { name: 'deb-arm64-openssl3', description: publicDescriptions.debian_arm64, packageType: 'deb with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-arm64-openssl3', description: publicDescriptions.rhel_arm64, packageType: 'rpm with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } + { name: 'linux-arm64-openssl3', description: 'Linux Tarball arm64 (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, + { name: 'deb-arm64-openssl3', description: 'Debian / Ubuntu arm64 (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-arm64-openssl3', description: 'RHEL / CentOS arm64 (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } ] }, { executableOsId: 'linux-ppc64le', compileBuildVariant: 'linux_ppc64le_build', packages: [ - { name: 'linux-ppc64le', description: publicDescriptions.linux_ppc64le, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel81AndAbove] }, - { name: 'rpm-ppc64le', description: publicDescriptions.rhel_ppc64le, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel81AndAbove] } + { name: 'linux-ppc64le', description: 'Linux Tarball ppc64le', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel81AndAbove] }, + { name: 'rpm-ppc64le', description: 'Redhat / Centos ppc64le', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel81AndAbove] } ] }, { executableOsId: 'linux-s390x', compileBuildVariant: 'linux_s390x_build', packages: [ - { name: 'linux-s390x', description: publicDescriptions.linux_s390x, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel72AndAbove] }, - { name: 'rpm-s390x', description: publicDescriptions.rhel_s390x, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel72AndAbove] } + { name: 'linux-s390x', description: 'Linux Tarball s390x', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel72AndAbove] }, + { name: 'rpm-s390x', description: 'Redhat / Centos s390x', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel72AndAbove] } ] }, { executableOsId: 'win32', compileBuildVariant: 'win32_build', packages: [ - { name: 'win32-x64', description: publicDescriptions.win32_x64, packageType: 'zip', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] }, - { name: 'win32msi-x64', description: publicDescriptions.win32_x64, packageType: 'msi', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] } + { name: 'win32-x64', description: 'Windows 64-bit (8.1+)', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] }, + { name: 'win32msi-x64', description: 'Windows 64-bit (8.1+) (MSI)', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] } ] } ]; diff --git a/package-lock.json b/package-lock.json index ec1ea97fb5..4b03e0e1a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9494,13 +9494,16 @@ } }, "node_modules/@mongodb-js/dl-center": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.1.1.tgz", - "integrity": "sha512-1cqBYtfMdoOtW3D8MNknhbub1Z7SI/31zPRlHMxmFuwjEittESlBBCa/20OVi6QdjxHgi2hE1j9sJqKHM/fkBA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.0.1.tgz", + "integrity": "sha512-gUxfbhvYWjWK+QHyrB2iiwkN/EZqab6tJG33A7rNR5lPC9rmzzBAKU62AuB4vFhaMtT3m9Vswbu2040IqMm0xw==", "dependencies": { "ajv": "^6.12.5", - "aws-sdk": "^2.1441.0", - "node-fetch": "^2.6.7" + "aws-sdk": "^2.770.0", + "node-fetch": "^2.6.1" + }, + "engines": { + "node": ">= 12" } }, "node_modules/@mongodb-js/eslint-config-devtools": { @@ -12854,9 +12857,9 @@ } }, "node_modules/aws-sdk": { - "version": "2.1442.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1442.0.tgz", - "integrity": "sha512-Rp6kP813tdlg3R3Zi6Olt5NSutlx1UjhhoogJpEeIUQFXul7t/mu5FpyUZmYRsBN6TPCj9QD0eJOtBaFN4LZtg==", + "version": "2.1354.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz", + "integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==", "dependencies": { "buffer": "4.9.2", "events": "1.1.1", @@ -30227,7 +30230,7 @@ "license": "Apache-2.0", "dependencies": { "@mongodb-js/devtools-github-repo": "^1.0.1", - "@mongodb-js/dl-center": "^1.1.1", + "@mongodb-js/dl-center": "^1.0.1", "@mongodb-js/mongodb-downloader": "^0.2.7", "@octokit/rest": "^17.9.0", "aws-sdk": "^2.674.0", @@ -38993,13 +38996,13 @@ "integrity": "sha512-rBwJHZ0g3Ma6zluNUWfeFXvuxsz9ZtFX2YZ1qR/aQEwk64ZhOqjrVbcROSdtfGUs4qg1JGXFIU+ZQ+oLYqPEvQ==" }, "@mongodb-js/dl-center": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.1.1.tgz", - "integrity": "sha512-1cqBYtfMdoOtW3D8MNknhbub1Z7SI/31zPRlHMxmFuwjEittESlBBCa/20OVi6QdjxHgi2hE1j9sJqKHM/fkBA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.0.1.tgz", + "integrity": "sha512-gUxfbhvYWjWK+QHyrB2iiwkN/EZqab6tJG33A7rNR5lPC9rmzzBAKU62AuB4vFhaMtT3m9Vswbu2040IqMm0xw==", "requires": { "ajv": "^6.12.5", - "aws-sdk": "^2.1441.0", - "node-fetch": "^2.6.7" + "aws-sdk": "^2.770.0", + "node-fetch": "^2.6.1" } }, "@mongodb-js/eslint-config-devtools": { @@ -39522,7 +39525,7 @@ "version": "file:packages/build", "requires": { "@mongodb-js/devtools-github-repo": "^1.0.1", - "@mongodb-js/dl-center": "^1.1.1", + "@mongodb-js/dl-center": "^1.0.1", "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/mongodb-downloader": "^0.2.7", "@mongodb-js/prettier-config-devtools": "^1.0.1", @@ -42519,9 +42522,9 @@ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "aws-sdk": { - "version": "2.1442.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1442.0.tgz", - "integrity": "sha512-Rp6kP813tdlg3R3Zi6Olt5NSutlx1UjhhoogJpEeIUQFXul7t/mu5FpyUZmYRsBN6TPCj9QD0eJOtBaFN4LZtg==", + "version": "2.1354.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz", + "integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==", "requires": { "buffer": "4.9.2", "events": "1.1.1", diff --git a/packages/build/package.json b/packages/build/package.json index 939800d008..dd7ea48c0c 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -59,7 +59,7 @@ "dependencies": { "@mongodb-js/devtools-github-repo": "^1.0.1", "@mongodb-js/mongodb-downloader": "^0.2.7", - "@mongodb-js/dl-center": "^1.1.1", + "@mongodb-js/dl-center": "^1.0.1", "@octokit/rest": "^17.9.0", "aws-sdk": "^2.674.0", "boxednode": "^2.0.1", diff --git a/packages/build/src/config/build-variant.ts b/packages/build/src/config/build-variant.ts index e6964e6c94..2fba32bde5 100644 --- a/packages/build/src/config/build-variant.ts +++ b/packages/build/src/config/build-variant.ts @@ -114,15 +114,3 @@ export function getDownloadCenterDistroDescription( throw new Error(`${variant} is not a valid build variant`); } - -export function getDownloadCenterPackageType(variant: PackageVariant): string { - for (const { packages } of RELEASE_PACKAGE_MATRIX) { - for (const pkg of packages) { - if (pkg.name === variant) { - return pkg.packageType; - } - } - } - - throw new Error(`${variant} is not a valid build variant`); -} diff --git a/packages/build/src/download-center/config.spec.ts b/packages/build/src/download-center/config.spec.ts index b68ef41e28..0daa70b0c8 100644 --- a/packages/build/src/download-center/config.spec.ts +++ b/packages/build/src/download-center/config.spec.ts @@ -1,7 +1,4 @@ -import type { - DownloadCenterConfig, - PlatformWithPackages, -} from '@mongodb-js/dl-center/dist/download-center-config'; +import type { DownloadCenterConfig } from '@mongodb-js/dl-center/dist/download-center-config'; import type { PackageInformationProvider } from '../packaging'; import { expect } from 'chai'; import sinon from 'sinon'; @@ -43,27 +40,25 @@ describe('DownloadCenter config', function () { expect(version.version).to.equal('1.2.2'); }); - it('has an artifact for MacOS x64 (10.14+)', function () { + it('has an artifact for darwin', function () { const version = createVersionConfig(packageInformation('1.2.2')); - const platforms = version.platform.filter( - (p) => p.os === 'MacOS x64 (10.14+)' - ); - expect(platforms).to.have.length(1); - expect(platforms[0].packages.links[0].name).to.include('zip'); - expect(platforms[0].packages.links[0].download_link).to.include( + const platforms = version.platform.filter((p) => p.os === 'darwin'); + expect(platforms).to.have.length(2); + expect(platforms[0].download_link).to.include( 'mongosh-1.2.2-darwin-x64.zip' ); + expect(platforms[1].download_link).to.include( + 'mongosh-1.2.2-darwin-arm64.zip' + ); }); it('has an artifact for linux', function () { const version = createVersionConfig(packageInformation('1.2.2')); const platforms = version.platform.filter( - (p) => p.os.startsWith('Linux x64') && p.arch === 'x64' + (p) => p.os === 'linux' && p.arch === 'x64' ); - expect(platforms).to.have.length(1); - expect( - platforms.flatMap((p) => p.packages.links.map((l) => l.download_link)) - ).to.deep.equal([ + expect(platforms).to.have.length(3); + expect(platforms.map((p) => p.download_link)).to.deep.equal([ 'https://downloads.mongodb.com/compass/mongosh-1.2.2-linux-x64.tgz', 'https://downloads.mongodb.com/compass/mongosh-1.2.2-linux-x64-openssl11.tgz', 'https://downloads.mongodb.com/compass/mongosh-1.2.2-linux-x64-openssl3.tgz', @@ -72,26 +67,23 @@ describe('DownloadCenter config', function () { it('has an MSI and ZIP artifacts for windows', function () { const version = createVersionConfig(packageInformation('1.2.2')); - const [platform] = version.platform.filter( - (p) => p.os === 'Windows x64 (8.1+)' - ); - expect(platform.packages.links[0].download_link).to.contain( - 'win32-x64.zip' + const platforms = version.platform.filter( + (p) => p.os === 'win32' || p.os === 'win32msi' ); - expect(platform.packages.links[0].name).to.equal('zip'); - expect(platform.packages.links[1].download_link).to.contain('x64.msi'); - expect(platform.packages.links[1].name).to.contain('msi'); + expect(platforms).to.have.length(2); + expect(platforms.map((p) => p.download_link)).to.deep.equal([ + 'https://downloads.mongodb.com/compass/mongosh-1.2.2-win32-x64.zip', + 'https://downloads.mongodb.com/compass/mongosh-1.2.2-x64.msi', + ]); }); it('has an artifact for rpm', function () { const version = createVersionConfig(packageInformation('1.2.2')); const platforms = version.platform.filter( - (p) => p.os.startsWith('RHEL') && p.arch === 'x64' + (p) => p.os === 'rpm' && p.arch === 'x64' ); - expect(platforms).to.have.length(1); - expect( - platforms.flatMap((p) => p.packages.links.map((l) => l.download_link)) - ).to.deep.equal([ + expect(platforms).to.have.length(3); + expect(platforms.map((p) => p.download_link)).to.deep.equal([ 'https://downloads.mongodb.com/compass/mongodb-mongosh-1.2.2.x86_64.rpm', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11-1.2.2.x86_64.rpm', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3-1.2.2.x86_64.rpm', @@ -101,12 +93,10 @@ describe('DownloadCenter config', function () { it('has an artifact for deb', function () { const version = createVersionConfig(packageInformation('1.2.2')); const platforms = version.platform.filter( - (p) => p.os.startsWith('Debian') && p.arch === 'x64' + (p) => p.os === 'deb' && p.arch === 'x64' ); - expect(platforms).to.have.length(1); - expect( - platforms.flatMap((p) => p.packages.links.map((l) => l.download_link)) - ).to.deep.equal([ + expect(platforms).to.have.length(3); + expect(platforms.map((p) => p.download_link)).to.deep.equal([ 'https://downloads.mongodb.com/compass/mongodb-mongosh_1.2.2_amd64.deb', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11_1.2.2_amd64.deb', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_1.2.2_amd64.deb', diff --git a/packages/build/src/download-center/config.ts b/packages/build/src/download-center/config.ts index de3162521b..4c3414bc1a 100644 --- a/packages/build/src/download-center/config.ts +++ b/packages/build/src/download-center/config.ts @@ -3,10 +3,7 @@ import { validateConfigSchema, } from '@mongodb-js/dl-center'; import { major as majorVersion } from 'semver'; -import type { - DownloadCenterConfig, - PlatformWithPackages, -} from '@mongodb-js/dl-center/dist/download-center-config'; +import type { DownloadCenterConfig } from '@mongodb-js/dl-center/dist/download-center-config'; import { ARTIFACTS_BUCKET, ARTIFACTS_FOLDER, @@ -22,7 +19,6 @@ import { getDistro, getServerLikeArchName, getServerLikeTargetList, - getDownloadCenterPackageType, } from '../config'; import type { PackageInformationProvider } from '../packaging'; import { getPackageFile } from '../packaging'; @@ -170,31 +166,18 @@ export function createVersionConfig( publicArtifactBaseUrl: string = ARTIFACTS_URL_PUBLIC_BASE ) { const { version } = packageInformation('linux-x64').metadata; - const platformMap: Map = new Map(); - - for (const packageVariant of ALL_PACKAGE_VARIANTS) { - const platformName = getDownloadCenterDistroDescription(packageVariant); - const currentPlatform = platformMap.get(platformName) || { + return { + _id: version, + version: version, + platform: ALL_PACKAGE_VARIANTS.map((packageVariant: PackageVariant) => ({ arch: getArch(packageVariant), - os: getDownloadCenterDistroDescription(packageVariant), - packages: { links: [] }, - }; - - currentPlatform.packages.links.push({ - name: getDownloadCenterPackageType(packageVariant), + os: getDistro(packageVariant), + name: getDownloadCenterDistroDescription(packageVariant), download_link: publicArtifactBaseUrl + getPackageFile(packageVariant, packageInformation).path, - }); - - platformMap.set(platformName, currentPlatform); - } - - return { - _id: version, - version: version, - platform: [...platformMap.values()], - }; + })), + } as const; } interface JsonFeed { diff --git a/packages/build/src/packaging/package/get-package-file.ts b/packages/build/src/packaging/package/get-package-file.ts index eaead18077..115fa88b7c 100644 --- a/packages/build/src/packaging/package/get-package-file.ts +++ b/packages/build/src/packaging/package/get-package-file.ts @@ -12,48 +12,23 @@ export interface PackageFile { contentType: string; } -type PackageFileExtension = 'dmg' | 'tgz' | 'deb' | 'rpm' | 'zip' | 'msi'; - -export function getFileExtension( - packageVariant: PackageVariant -): PackageFileExtension { - switch (getDistro(packageVariant)) { - case 'linux': - return 'tgz'; - case 'rpm': - return 'rpm'; - case 'deb': - return 'deb'; - case 'darwin': - case 'win32': - return 'zip'; - case 'win32msi': - return 'msi'; - default: - throw new Error(`Unknown build variant: ${packageVariant}`); - } -} - export function getPackageFile( packageVariant: PackageVariant, packageInformation: PackageInformationProvider ): PackageFile { const { version, name, debName, rpmName } = packageInformation(packageVariant).metadata; - - const fileExtension = getFileExtension(packageVariant); - switch (getDistro(packageVariant)) { case 'linux': return { - path: `${name}-${version}-${packageVariant}.${fileExtension}`, + path: `${name}-${version}-${packageVariant}.tgz`, contentType: 'application/gzip', }; case 'rpm': return { path: `${rpmName}-${version}.${getRPMArchName( getArch(packageVariant) - )}.${fileExtension}`, + )}.rpm`, contentType: 'application/x-rpm', }; case 'deb': @@ -63,18 +38,18 @@ export function getPackageFile( return { path: `${debName}_${version}_${getDebArchName( getArch(packageVariant) - )}.${fileExtension}`, + )}.deb`, contentType: 'application/vnd.debian.binary-package', }; case 'darwin': case 'win32': return { - path: `${name}-${version}-${packageVariant}.${fileExtension}`, + path: `${name}-${version}-${packageVariant}.zip`, contentType: 'application/zip', }; case 'win32msi': return { - path: `${name}-${version}-${getArch(packageVariant)}.${fileExtension}`, + path: `${name}-${version}-${getArch(packageVariant)}.msi`, contentType: 'application/x-msi', }; default: