diff --git a/astro.config.mjs b/astro.config.mjs index 1a750f39..6f03b7b8 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,6 +1,7 @@ import { defineConfig } from "astro/config" import { plainTextPlugin } from "@barnabask/astro-minisearch" import { remarkReadingTime } from "./src/lib/remark-reading-time.mjs" +import downloadDdevRedirects from "./src/lib/download-ddev-redirects.js" import prefetch from "@astrojs/prefetch" import react from "@astrojs/react" import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links" @@ -30,7 +31,7 @@ export default defineConfig({ item.url.endsWith(".svg/") || item.url.endsWith(".xml/") ) { - // Don’t index sitemaps or generated SVG, which come with `/` route endings here + // Don't index sitemaps or generated SVG, which come with `/` route endings here return undefined } return item @@ -42,6 +43,7 @@ export default defineConfig({ searchIndex({ output: "search.json", }), + downloadDdevRedirects(), prefetch(), ], markdown: { diff --git a/public/_redirects b/public/_redirects index 1b1a2c16..6387d34a 100644 --- a/public/_redirects +++ b/public/_redirects @@ -35,3 +35,5 @@ /author/heather /blog/author/heather-mcnamee 301 /author/rfay /blog/author/randy-fay 301 /author/rmanelius /blog/author/rick-manelius 301 + +# See src/lib/download-ddev-redirects.js for additional redirects diff --git a/src/components/CtaButton.astro b/src/components/CtaButton.astro index 249f5c1d..81035e9d 100644 --- a/src/components/CtaButton.astro +++ b/src/components/CtaButton.astro @@ -4,6 +4,7 @@ export interface Props { href: string type?: string target?: string + title?: string } const typeClasses = { @@ -11,14 +12,15 @@ const typeClasses = { hollow: `border border-blue-650 text-blue-650 hover:border-blue-800 hover:text-blue-800 dark:hover:text-blue-500 hover:border-blue-500`, } -const { text, href, type = "default", target } = Astro.props +const { text, href, type = "default", target, title } = Astro.props --- {text} diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 63e5c17a..6fd71aef 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -28,6 +28,7 @@ const navigation = { ], product: [ { name: "About", href: "/about" }, + { name: "Download", href: "/download" }, { name: "Swag Shop", href: STORE_URL, target: "_blank"}, { name: "Contributing", href: "/support-ddev" }, { name: "Contributor Live Training", href: "/blog/contributor-training"}, diff --git a/src/components/Header.astro b/src/components/Header.astro index 5f32ac2c..05d15428 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -83,6 +83,13 @@ import SponsorsBanner from "./SponsorsBanner.astro" rel="prefetch">Get Started +
  • + Download +
  • Get Started
  • +
  • + Download +
  • -
    +
    +
    +
      +
    • AMD64 (x86-64): Most traditional Windows PCs (Intel/AMD processors)
    • +
    • ARM64: Windows on ARM devices like Microsoft Surface Pro X, Surface Pro 9 (5G), or other ARM-based Windows devices
    • +
    +

    Run the installer selecting the preferred "Docker CE" approach and selecting your "DDEV" distro. You can also find all releases at DDEV Releases.

    diff --git a/src/lib/api.ts b/src/lib/api.ts index c4ab4bf5..77c8a1fb 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -208,14 +208,14 @@ export async function getRepoDetails(name: string) { } /** - * Gets the most recent `ddev/ddev` tag name, like `v1.21.4`. + * Gets the most recent `ddev/ddev` tag name, like `v1.24.10`. * * @param stable Whether to return stable releases only (`true` by default). * @returns tag name */ export async function getLatestReleaseVersion(stable = true) { if (!githubTokenIsSet) { - return [] + return "v1.24.9" // Fallback version for local development without token } let data = await getReleases() diff --git a/src/lib/download-ddev-redirects.js b/src/lib/download-ddev-redirects.js new file mode 100644 index 00000000..fc81c846 --- /dev/null +++ b/src/lib/download-ddev-redirects.js @@ -0,0 +1,123 @@ +import fs from "fs" +import path from "path" +import { getLatestReleaseVersion } from "./api.ts" +import { GITHUB_REPO } from "../const.js" + +export default function downloadDdevRedirects() { + return { + name: "download-ddev-redirects", + hooks: { + "astro:build:done": async ({ dir }) => { + const rawVersion = await getLatestReleaseVersion() // e.g. "v1.24.10" + const version = rawVersion.replace(/^v/, "") // → "1.24.10" + + const baseUrl = `https://github.com/${GITHUB_REPO}/releases/download/${rawVersion}` + + const assets = [ + // Checksums + { + path: "/download/checksums.txt", + file: "checksums.txt", + }, + + // Windows + { + path: "/download/ddev_windows_amd64_installer.exe", + file: `ddev_windows_amd64_installer.v${version}.exe`, + }, + { + path: "/download/ddev_windows_arm64_installer.exe", + file: `ddev_windows_arm64_installer.v${version}.exe`, + }, + { + path: "/download/ddev_windows-amd64.zip", + file: `ddev_windows-amd64.v${version}.zip`, + }, + { + path: "/download/ddev_windows-arm64.zip", + file: `ddev_windows-arm64.v${version}.zip`, + }, + + // Linux - deb/rpm + { + path: "/download/ddev_linux_amd64.deb", + file: `ddev_${version}_linux_amd64.deb`, + }, + { + path: "/download/ddev_linux_arm64.deb", + file: `ddev_${version}_linux_arm64.deb`, + }, + { + path: "/download/ddev_linux_amd64.rpm", + file: `ddev_${version}_linux_amd64.rpm`, + }, + { + path: "/download/ddev_linux_arm64.rpm", + file: `ddev_${version}_linux_arm64.rpm`, + }, + + // Linux - tar.gz + { + path: "/download/ddev_linux-amd64.tar.gz", + file: `ddev_linux-amd64.v${version}.tar.gz`, + }, + { + path: "/download/ddev_linux-arm64.tar.gz", + file: `ddev_linux-arm64.v${version}.tar.gz`, + }, + + // Linux - WSL2 + { + path: "/download/ddev-wsl2_linux_amd64.deb", + file: `ddev-wsl2_${version}_linux_amd64.deb`, + }, + { + path: "/download/ddev-wsl2_linux_arm64.deb", + file: `ddev-wsl2_${version}_linux_arm64.deb`, + }, + { + path: "/download/ddev-wsl2_linux_amd64.rpm", + file: `ddev-wsl2_${version}_linux_amd64.rpm`, + }, + { + path: "/download/ddev-wsl2_linux_arm64.rpm", + file: `ddev-wsl2_${version}_linux_arm64.rpm`, + }, + + // macOS + { + path: "/download/ddev_macos-amd64.tar.gz", + file: `ddev_macos-amd64.v${version}.tar.gz`, + }, + { + path: "/download/ddev_macos-arm64.tar.gz", + file: `ddev_macos-arm64.v${version}.tar.gz`, + }, + + // Shell completion scripts + { + path: "/download/ddev_shell_completion_scripts.tar.gz", + file: `ddev_shell_completion_scripts.v${version}.tar.gz`, + }, + ] + + const redirectsPath = path.join(dir.pathname, "_redirects") + let redirectsContent = fs.readFileSync(redirectsPath, "utf8") + + let downloadRedirects = + "\n\n# DDEV download redirects (generated at build time)" + + for (const asset of assets) { + downloadRedirects += `\n${asset.path} ${baseUrl}/${asset.file} 302` + } + + const finalContent = redirectsContent.trim() + downloadRedirects + "\n" + fs.writeFileSync(redirectsPath, finalContent) + + console.log( + `[download-ddev-redirects] Generated ${assets.length} redirect(s) for version ${rawVersion}` + ) + }, + }, + } +} diff --git a/src/pages/download.astro b/src/pages/download.astro new file mode 100644 index 00000000..beb23df6 --- /dev/null +++ b/src/pages/download.astro @@ -0,0 +1,225 @@ +--- +import Layout from "../layouts/Layout.astro" +import { getLatestReleaseVersion } from "../lib/api" +import { GITHUB_URL } from "../const" + +const title = "Download DDEV" + +// GitHub returns version WITH leading "v" +const rawVersion = await getLatestReleaseVersion() // e.g. "v1.24.10" +const version = rawVersion.replace(/^v/, "") // → "1.24.10" + +// Organize downloads by platform +const downloads = { + macos: { + title: "macOS", + items: [ + { + name: "macOS Archive (Apple Silicon)", + file: `ddev_macos-arm64.v${version}.tar.gz`, + path: "/download/ddev_macos-arm64.tar.gz", + description: "For Apple Silicon Macs (M Series)", + }, + { + name: "macOS Archive (Intel)", + file: `ddev_macos-amd64.v${version}.tar.gz`, + path: "/download/ddev_macos-amd64.tar.gz", + description: "For Intel-based Macs", + }, + ], + }, + + windows: { + title: "WSL2 and Traditional Windows", + items: [ + { + name: "Windows Installer (amd64) - Recommended", + file: `ddev_windows_amd64_installer.v${version}.exe`, + path: "/download/ddev_windows_amd64_installer.exe", + description: "Recommended installer for WSL2 and Traditional Windows (64-bit Intel/AMD)", + }, + { + name: "Windows Installer (arm64) - Recommended", + file: `ddev_windows_arm64_installer.v${version}.exe`, + path: "/download/ddev_windows_arm64_installer.exe", + description: "Recommended installer for WSL2 and Traditional Windows on ARM devices", + }, + { + name: "Windows Portable (amd64)", + file: `ddev_windows-amd64.v${version}.zip`, + path: "/download/ddev_windows-amd64.zip", + description: "Portable ZIP archive for Traditional Windows (64-bit Intel/AMD)", + }, + { + name: "Windows Portable (arm64)", + file: `ddev_windows-arm64.v${version}.zip`, + path: "/download/ddev_windows-arm64.zip", + description: "Portable ZIP archive for Traditional Windows on ARM devices", + }, + { + name: "WSL2 Installer (Docker CE) - Legacy", + file: "install_ddev_wsl2_docker_inside.ps1", + url: "https://raw.githubusercontent.com/ddev/ddev/main/scripts/install_ddev_wsl2_docker_inside.ps1", + description: "Legacy PowerShell script for WSL2 with Docker inside WSL2 (obsolete, use Windows Installer instead)", + }, + { + name: "WSL2 Installer (Docker Desktop) - Legacy", + file: "install_ddev_wsl2_docker_desktop.ps1", + url: "https://raw.githubusercontent.com/ddev/ddev/main/scripts/install_ddev_wsl2_docker_desktop.ps1", + description: "Legacy PowerShell script for WSL2 with Docker Desktop (obsolete, use Windows Installer instead)", + }, + ], + }, + + linux: { + title: "Linux and WSL2", + items: [ + { + name: "Debian/Ubuntu (amd64)", + file: `ddev_${version}_linux_amd64.deb`, + path: "/download/ddev_linux_amd64.deb", + description: "For Debian, Ubuntu, WSL2, and derivatives (64-bit Intel/AMD)", + }, + { + name: "Debian/Ubuntu (arm64)", + file: `ddev_${version}_linux_arm64.deb`, + path: "/download/ddev_linux_arm64.deb", + description: "For Debian, Ubuntu, WSL2, and derivatives (ARM64)", + }, + { + name: "RPM Package (amd64)", + file: `ddev_${version}_linux_amd64.rpm`, + path: "/download/ddev_linux_amd64.rpm", + description: "For Fedora, RHEL, CentOS, WSL2, and derivatives (64-bit Intel/AMD)", + }, + { + name: "RPM Package (arm64)", + file: `ddev_${version}_linux_arm64.rpm`, + path: "/download/ddev_linux_arm64.rpm", + description: "For Fedora, RHEL, CentOS, WSL2, and derivatives (ARM64)", + }, + { + name: "Linux Archive (amd64)", + file: `ddev_linux-amd64.v${version}.tar.gz`, + path: "/download/ddev_linux-amd64.tar.gz", + description: "Portable TAR archive for Linux and WSL2 (64-bit Intel/AMD)", + }, + { + name: "Linux Archive (arm64)", + file: `ddev_linux-arm64.v${version}.tar.gz`, + path: "/download/ddev_linux-arm64.tar.gz", + description: "Portable TAR archive for Linux and WSL2 (ARM64)", + }, + { + name: "WSL2 Additional Package - DEB (amd64)", + file: `ddev-wsl2_${version}_linux_amd64.deb`, + path: "/download/ddev-wsl2_linux_amd64.deb", + description: "Additional package for WSL2 on Debian, Ubuntu (64-bit Intel/AMD)", + }, + { + name: "WSL2 Additional Package - DEB (arm64)", + file: `ddev-wsl2_${version}_linux_arm64.deb`, + path: "/download/ddev-wsl2_linux_arm64.deb", + description: "Additional package for WSL2 on Debian, Ubuntu (ARM64)", + }, + { + name: "WSL2 Additional Package - RPM (amd64)", + file: `ddev-wsl2_${version}_linux_amd64.rpm`, + path: "/download/ddev-wsl2_linux_amd64.rpm", + description: "Additional package for WSL2 on Fedora, RHEL, CentOS (64-bit Intel/AMD)", + }, + { + name: "WSL2 Additional Package - RPM (arm64)", + file: `ddev-wsl2_${version}_linux_arm64.rpm`, + path: "/download/ddev-wsl2_linux_arm64.rpm", + description: "Additional package for WSL2 on Fedora, RHEL, CentOS (ARM64)", + }, + ], + }, + + other: { + title: "Other", + items: [ + { + name: "Checksums", + file: "checksums.txt", + path: "/download/checksums.txt", + description: "SHA256 checksums for all release files", + }, + { + name: "Shell Completion Scripts", + file: `ddev_shell_completion_scripts.v${version}.tar.gz`, + path: "/download/ddev_shell_completion_scripts.tar.gz", + description: "Bash, Zsh, Fish, and PowerShell completion scripts", + }, + ], + }, +} +--- + + +

    + + +
    +
    +

    + Most users (except on Windows) should use package managers like Homebrew (macOS) and apt (Ubuntu). +

    +

    + See quick instructions or full installation docs. +

    +
    + + { + Object.entries(downloads).map(([_key, section]) => ( +
    +

    + {section.title} +

    + +
    + )) + } +
    +
    +