From 74bbe009f7a0ef92938cb4d6283ab3318b139d1e Mon Sep 17 00:00:00 2001 From: Viacheslav Klimov Date: Mon, 6 Jul 2026 16:07:23 +0300 Subject: [PATCH] Drop trailing .0 in CE/PE package download links for GA releases For a GA (X.Y.0), dist artifact filenames and the CE GitHub release tag drop the trailing .0 (thingsboard-4.4.deb, tag v4.4, 4.4pe) while Docker image tags and the pom/Maven version keep the full X.Y.0. Package links and Docker tags both derived from CE_FULL_VER, so at a GA the download links would 404 against the dropped-.0 artifacts. Add a derived CE_PKG_VER (strips the trailing .0 for a GA, else unchanged) and re-derive PE_PKG_VER the same way. CE .deb/.rpm links in the Ubuntu, RHEL and Raspberry Pi install guides now use CE_PKG_VER; Docker tags and TB_VER keep CE_FULL_VER. Patches and GA hotfixes are unaffected (constants equal the full version), so the current 4.3.1.3 release renders byte-identically. --- .../_includes/docs/installation/rhel.mdx | 4 +-- .../_includes/docs/installation/ubuntu.mdx | 8 ++--- src/content/docs/docs/installation/rpi.mdx | 6 ++-- src/data/versions.ts | 35 +++++++++++++++---- 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/content/_includes/docs/installation/rhel.mdx b/src/content/_includes/docs/installation/rhel.mdx index f20aca4be1..b198ee131f 100644 --- a/src/content/_includes/docs/installation/rhel.mdx +++ b/src/content/_includes/docs/installation/rhel.mdx @@ -1,11 +1,11 @@ import DocLink from '@components/DocLink.astro'; import { Aside, Code, Tabs, TabItem } from '@astrojs/starlight/components'; -import { CE_FULL_VER, PE_FULL_VER, PE_PKG_VER } from '~/data/versions'; +import { CE_FULL_VER, CE_PKG_VER, PE_FULL_VER, PE_PKG_VER } from '~/data/versions'; import { Products } from '~/models/site.models'; import DocSection from '~/components/DocSection.astro'; import QueueIntro from '@includes/docs/installation/queue-intro.mdx'; -export const ceInstallFull = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_FULL_VER}/thingsboard-${CE_FULL_VER}.rpm\nsudo rpm -Uvh thingsboard-${CE_FULL_VER}.rpm`; +export const ceInstallFull = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_PKG_VER}/thingsboard-${CE_PKG_VER}.rpm\nsudo rpm -Uvh thingsboard-${CE_PKG_VER}.rpm`; export const peInstallFull = `wget https://dist.thingsboard.io/thingsboard-${PE_PKG_VER}.rpm\nsudo rpm -Uvh thingsboard-${PE_PKG_VER}.rpm`; export const peDownloadWebReport = `wget https://dist.thingsboard.io/tb-web-report-${PE_PKG_VER}.rpm`; diff --git a/src/content/_includes/docs/installation/ubuntu.mdx b/src/content/_includes/docs/installation/ubuntu.mdx index 3489eef43d..0324363a0b 100644 --- a/src/content/_includes/docs/installation/ubuntu.mdx +++ b/src/content/_includes/docs/installation/ubuntu.mdx @@ -1,15 +1,15 @@ import DocLink from '@components/DocLink.astro'; import { Aside, Code, Tabs, TabItem } from '@astrojs/starlight/components'; -import { CE_FULL_VER, PE_FULL_VER, PE_PKG_VER } from '~/data/versions'; +import { CE_FULL_VER, CE_PKG_VER, PE_FULL_VER, PE_PKG_VER } from '~/data/versions'; import { Products } from '~/models/site.models'; import DocSection from '~/components/DocSection.astro'; import QueueIntro from '@includes/docs/installation/queue-intro.mdx'; -export const ceDownloadDeb = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_FULL_VER}/thingsboard-${CE_FULL_VER}.deb`; +export const ceDownloadDeb = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_PKG_VER}/thingsboard-${CE_PKG_VER}.deb`; export const peDownloadDeb = `wget https://dist.thingsboard.io/thingsboard-${PE_PKG_VER}.deb`; -export const ceInstallDeb = `sudo dpkg -i thingsboard-${CE_FULL_VER}.deb`; +export const ceInstallDeb = `sudo dpkg -i thingsboard-${CE_PKG_VER}.deb`; export const peInstallDeb = `sudo dpkg -i thingsboard-${PE_PKG_VER}.deb`; -export const ceInstallFull = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_FULL_VER}/thingsboard-${CE_FULL_VER}.deb\nsudo dpkg -i thingsboard-${CE_FULL_VER}.deb`; +export const ceInstallFull = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_PKG_VER}/thingsboard-${CE_PKG_VER}.deb\nsudo dpkg -i thingsboard-${CE_PKG_VER}.deb`; export const peInstallFull = `wget https://dist.thingsboard.io/thingsboard-${PE_PKG_VER}.deb\nsudo dpkg -i thingsboard-${PE_PKG_VER}.deb`; export const peDownloadWebReport = `wget https://dist.thingsboard.io/tb-web-report-${PE_PKG_VER}.deb`; export const setLicenseSecret = `TB_LICENSE_SECRET=YOUR_LICENSE_SECRET`; diff --git a/src/content/docs/docs/installation/rpi.mdx b/src/content/docs/docs/installation/rpi.mdx index 23feb8b532..6be43c785a 100644 --- a/src/content/docs/docs/installation/rpi.mdx +++ b/src/content/docs/docs/installation/rpi.mdx @@ -7,13 +7,13 @@ sidebar: import DocLink from '@components/DocLink.astro'; import { Steps, Aside } from '@astrojs/starlight/components'; import { Code } from '@astrojs/starlight/components'; -import { CE_FULL_VER } from '~/data/versions'; +import { CE_PKG_VER } from '~/data/versions'; import { Products } from '~/models/site.models'; import Tabs from '@components/Tabs.astro'; import TabItem from '@components/TabItem.astro'; -export const downloadDeb = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_FULL_VER}/thingsboard-${CE_FULL_VER}.deb`; -export const installDeb = `sudo dpkg -i thingsboard-${CE_FULL_VER}.deb`; +export const downloadDeb = `wget https://github.com/thingsboard/thingsboard/releases/download/v${CE_PKG_VER}/thingsboard-${CE_PKG_VER}.deb`; +export const installDeb = `sudo dpkg -i thingsboard-${CE_PKG_VER}.deb`; This guide walks you through installing ThingsBoard Community Edition on a Raspberry Pi. diff --git a/src/data/versions.ts b/src/data/versions.ts index 9c0fcaf6df..90d7b733e5 100644 --- a/src/data/versions.ts +++ b/src/data/versions.ts @@ -11,6 +11,28 @@ export const CE_FULL_VER = '4.3.1.3'; export const TB_VER = CE_FULL_VER; +/** + * Artifact/package version for dist filenames and the CE GitHub release tag. + * + * A GA release (exactly `X.Y.0`) drops the trailing `.0` in artifact filenames, + * the CE git tag, and the PE package label (e.g. `4.4.0` → `4.4`, tag `v4.4`, + * `4.4pe`). Patches (`X.Y.Z`, Z > 0) and GA hotfixes (`X.Y.0.P`) keep the full + * version everywhere, so this equals the input for them. Docker image tags and + * the pom/Maven version ({@link CE_FULL_VER} / {@link PE_FULL_VER} / + * {@link TB_VER}) always keep the full `X.Y.0` — do NOT use this for those. + */ +const artifactVersion = (v: string): string => (/^\d+\.\d+\.0$/.test(v) ? v.slice(0, -2) : v); + +/** + * Community Edition — package filename / download-tag version. + * + * Derived from {@link CE_FULL_VER} so a single source of truth bumps both Docker + * tags and package URLs on release, dropping the trailing `.0` for a GA (see + * {@link artifactVersion}). Used for `thingsboard-${CE_PKG_VER}.deb` / `.rpm` + * and `releases/download/v${CE_PKG_VER}/…`. + */ +export const CE_PKG_VER = artifactVersion(CE_FULL_VER); + /** * Community Edition release branch (X.Y format) — only for repos branched per * minor release: `thingsboard`, `rule-node-examples`. For k8s repos use @@ -31,13 +53,14 @@ export const PE_FULL_VER = '4.3.1.3PE'; /** * Professional Edition — package filename suffix (dist.thingsboard.io). * - * Derived from {@link PE_FULL_VER} via `.toLowerCase()` so a single source - * of truth bumps both Docker tags and package URLs on release. Used for - * `thingsboard-${PE_PKG_VER}.deb`, `.rpm`, `tb-web-report-${PE_PKG_VER}.deb`, - * `thingsboard-windows-${PE_PKG_VER}.zip`, and any other dist asset URL — - * the dist host serves PE packages with lowercase `pe`. + * Derived from {@link CE_FULL_VER} so a single source of truth bumps both + * Docker tags and package URLs on release, dropping the trailing `.0` for a GA + * (see {@link artifactVersion}) and appending the lowercase `pe` suffix the + * dist host serves PE packages with. Used for `thingsboard-${PE_PKG_VER}.deb`, + * `.rpm`, `tb-web-report-${PE_PKG_VER}.deb`, `thingsboard-windows-${PE_PKG_VER}.zip`, + * and any other dist asset URL. (For a patch this equals `PE_FULL_VER.toLowerCase()`.) */ -export const PE_PKG_VER = PE_FULL_VER.toLowerCase(); +export const PE_PKG_VER = `${artifactVersion(CE_FULL_VER)}pe`; /** Trendz Analytics */ export const TRENDZ_VER = '1.15.2';