From 918470a2bbc862e9ffe55ed98dda0937f82b6117 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 16 Apr 2025 08:59:17 -0400 Subject: [PATCH] Closes #19208: Ignore beta releases when fetching latest release tag --- docs/installation/upgrading.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/installation/upgrading.md b/docs/installation/upgrading.md index 993d3987d..102e8de17 100644 --- a/docs/installation/upgrading.md +++ b/docs/installation/upgrading.md @@ -124,17 +124,19 @@ sudo cp /opt/netbox-$OLDVER/gunicorn.py /opt/netbox/ ### Option B: Check Out a Git Release -This guide assumes that NetBox is installed at `/opt/netbox`. First, determine the latest release either by visiting our [releases page](https://github.com/netbox-community/netbox/releases) or by running the following `git` commands: +This guide assumes that NetBox is installed at `/opt/netbox`. First, determine the latest release either by visiting our [releases page](https://github.com/netbox-community/netbox/releases) or by running the following command: ``` -sudo git fetch --tags -git describe --tags $(git rev-list --tags --max-count=1) +git ls-remote --tags https://github.com/netbox-community/netbox.git \ + | grep -o 'refs/tags/v[0-9]*\.[0-9]*\.[0-9]*$' \ + | tail -n 1 \ + | sed 's|refs/tags/||' ``` -Check out the desired release by specifying its tag: +Check out the desired release by specifying its tag. For example: ``` -sudo git checkout v4.2.0 +sudo git checkout v4.2.7 ``` ## 4. Run the Upgrade Script