Website: Fix failing deploy (#48438)

Changes:
- Updated the website's build-static-content script to use download URLs
from the next latest released version of Fleet when the latest release
does not contain installers for a platform in its release assets.
- Reduced the length of the description meta tag value in the "Block and
monitor EDR Freeze on macOS with Santa and Fleet" article
- Updated the labels values for two engineering rituals (The old label
was removed from the GH repo)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Improved resilience when generating fleetctl download links if the
latest GitHub release is missing one or more required platform installer
assets.
* The system now looks for the most recent release that contains the
complete installer set, warns for any missing platform, and fails only
if no complete set is available.

* **Documentation**
* Updated labels for two Apple-related engineering rituals to use the
correct label.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Eric
2026-06-29 13:50:10 -05:00
committed by GitHub
parent b547f1ab9f
commit 0656141665
3 changed files with 34 additions and 11 deletions
+31 -8
View File
@@ -1656,16 +1656,39 @@ module.exports = {
});
let downloadAssets = latestFleetReleaseDetails.assets;
let macOsInstaller = _.find(downloadAssets, (asset)=> { return _.endsWith(asset.browser_download_url, '_mac.pkg');});
if(!macOsInstaller) {
throw new Error(`When getting information about the latest release (${latestFleetReleaseDetails.name}) to get installer links for the download page, no installer for macOS was found in the release assets.`);
}
let windowsInstaller = _.find(downloadAssets, (asset)=> { return _.endsWith(asset.browser_download_url, '_windows_amd64.msi');});
if(!windowsInstaller) {
throw new Error(`When getting information about the latest release (${latestFleetReleaseDetails.name}) to get installer links for the download page, no installer for Windows (amd64) was found in the release assets.`);
}
let windowsArmInstaller = _.find(downloadAssets, (asset)=> { return _.endsWith(asset.browser_download_url, '_windows_arm64.msi');});
if(!windowsArmInstaller) {
throw new Error(`When getting information about the latest release (${latestFleetReleaseDetails.name}) to get installer links for the download page, no installer for Windows (arm64) was found in the release assets.`);
if(!macOsInstaller || !windowsInstaller || !windowsArmInstaller) {
let otherRecentFleetReleases = await sails.helpers.http.get.with({
url: 'https://api.github.com/repos/fleetdm/fleet/releases',
headers: baseHeadersForGithubRequests,
}).intercept((err) =>{
return new Error(`When sending a request to the GitHub API to get links for the latest released fleetctl installers, an error occurred. Full error: ${util.inspect(err)}`);
});
// Find all releases that contains all three installer assets.
let completeReleases = _.filter(otherRecentFleetReleases, (release)=>{
return _.some(release.assets, (asset)=> { return _.endsWith(asset.browser_download_url, '_mac.pkg');}) &&
_.some(release.assets, (asset)=> { return _.endsWith(asset.browser_download_url, '_windows_amd64.msi');}) &&
_.some(release.assets, (asset)=> { return _.endsWith(asset.browser_download_url, '_windows_arm64.msi');});
});
// Get the latest "complete" release to use.
let latestCompleteRelease = _.last(_.sortBy(completeReleases, (release)=>{ return new Date(release.published_at).getTime(); }));
if(!latestCompleteRelease) {
throw new Error(`When getting information about recent Fleet releases to find installers for the download page, no release containing macOS, Windows (amd64), and Windows (arm64) installers was found in the GitHub API response.`);
}
if(!macOsInstaller) {
sails.log.warn(`When getting information about the latest release (${latestFleetReleaseDetails.name}) to get installer links for the download page, no installer for macOS was found in the release assets. The download page will link to an older version (${latestCompleteRelease.name}) for macOS.`);
macOsInstaller = _.find(latestCompleteRelease.assets, (asset)=> { return _.endsWith(asset.browser_download_url, '_mac.pkg');});
}
if(!windowsInstaller) {
sails.log.warn(`When getting information about the latest release (${latestFleetReleaseDetails.name}) to get installer links for the download page, no installer for Windows (amd64) was found in the release assets. The download page will link to an older version (${latestCompleteRelease.name}) for Windows (amd64).`);
windowsInstaller = _.find(latestCompleteRelease.assets, (asset)=> { return _.endsWith(asset.browser_download_url, '_windows_amd64.msi');});
}
if(!windowsArmInstaller) {
sails.log.warn(`When getting information about the latest release (${latestFleetReleaseDetails.name}) to get installer links for the download page, no installer for Windows (arm64) was found in the release assets. The download page will link to an older version (${latestCompleteRelease.name}) for Windows (arm64).`);
windowsArmInstaller = _.find(latestCompleteRelease.assets, (asset)=> { return _.endsWith(asset.browser_download_url, '_windows_arm64.msi');});
}
}
builtStaticContent.fleetctlDownloadUrls = {
macOs: macOsInstaller.browser_download_url,