Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/content/_includes/docs/installation/rhel.mdx
Original file line number Diff line number Diff line change
@@ -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`;

Expand Down
8 changes: 4 additions & 4 deletions src/content/_includes/docs/installation/ubuntu.mdx
Original file line number Diff line number Diff line change
@@ -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`;
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/docs/installation/rpi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
35 changes: 29 additions & 6 deletions src/data/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small naming nit: the helper is artifactVersion but the constants it feeds are *_PKG_VER, and the JSDoc has to reconcile the two as 'Artifact/package version'. Renaming the helper to pkgVersion (or the constants to *_ARTIFACT_VER) would make the helper→constant relationship read at a glance without the doc bridging the vocabulary. Non-blocking.


/**
* 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
Expand All @@ -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`;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things here. First, artifactVersion(CE_FULL_VER) is recomputed on this line even though CE_PKG_VER (declared just above) already holds exactly that value. Reusing it is a touch cleaner and expresses the real relationship (PE package name = CE package name + a pe suffix):

export const PE_PKG_VER = `${CE_PKG_VER}pe`;

Second, deriving from CE_FULL_VER rather than PE_FULL_VER means PE_PKG_VER now silently ignores PE_FULL_VER — it works only because PE's numeric base always equals CE's. The JSDoc documents this well, but the code still reads as if it depends on PE_FULL_VER when it doesn't. Would a single shared numeric-base constant feeding all four of CE_FULL_VER / PE_FULL_VER / CE_PKG_VER / PE_PKG_VER make that invariant explicit, rather than hiding it behind a cross-edition reference?


/** Trendz Analytics */
export const TRENDZ_VER = '1.15.2';
Expand Down