diff --git a/.devcontainer.json b/.devcontainer.json index 6fb62d5..f01ca8b 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -3,7 +3,7 @@ { "name": "Salt Install Guide", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:0-3.10-bullseye", + "image": "mcr.microsoft.com/devcontainers/python:3.13-bookworm", "features": { "ghcr.io/devcontainers-contrib/features/pre-commit:2": { "version": "latest" diff --git a/.github/workflows/build-sphinx-docs.yml b/.github/workflows/build-sphinx-docs.yml index 98aff3b..1d09299 100644 --- a/.github/workflows/build-sphinx-docs.yml +++ b/.github/workflows/build-sphinx-docs.yml @@ -22,14 +22,14 @@ defaults: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.13' cache: pip - name: Run pre-commit run: | @@ -39,7 +39,7 @@ jobs: pre-commit run -a -v --color always - name: Build docs run: | - nox -e 'docs-html(download_versions=True, clean=True)' + nox -e 'docs-html(gen_sitevars=True, clean=True)' - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -52,7 +52,7 @@ jobs: deploy: permissions: contents: write - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: - build if: success() && startsWith(github.ref, 'refs/tags/') diff --git a/.gitignore b/.gitignore index 1a546e9..2ec736c 100644 --- a/.gitignore +++ b/.gitignore @@ -74,8 +74,7 @@ instance/ # Sphinx documentation docs/_build/ ## Generated stuff from Sphinx templates -# docs/sitevars.rst -# docs/topics/announcements.rst +docs/sitevars.rst # PyBuilder .pybuilder/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 192c9ea..ba183a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ --- -minimum_pre_commit_version: 2.9.3 +minimum_pre_commit_version: 4.0.1 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 diff --git a/.rstcheck.cfg b/.rstcheck.cfg index e1d2564..6219a6f 100644 --- a/.rstcheck.cfg +++ b/.rstcheck.cfg @@ -47,22 +47,24 @@ ignore_substitutions= windows-x86-exe-md5, windows-x86-exe-sha256, windows-amd64-exe-gpg, - macos-amd64-lts-download, - macos-arm64-lts-download, - macos-amd64-sts-download, - macos-arm64-sts-download, - minor-lts-version-badge, - minor-sts-version-badge, - windows-amd64-exe-lts-download, - windows-amd64-msi-lts-download, - windows-x86-exe-lts-download, - windows-x86-msi-lts-download, - windows-amd64-exe-sts-download, - windows-amd64-msi-sts-download, - windows-x86-exe-sts-download, - windows-x86-msi-sts-download, - minor-lts-version, - minor-sts-version, - relenv-lts-python-version, - relenv-sts-python-version, + macos-amd64-one-download, + macos-arm64-one-download, + macos-amd64-two-download, + macos-arm64-two-download, + minor-one-version-badge, + minor-two-version-badge, + windows-amd64-exe-one-download, + windows-amd64-msi-one-download, + windows-x86-exe-one-download, + windows-x86-msi-one-download, + windows-amd64-exe-two-download, + windows-amd64-msi-two-download, + windows-x86-exe-two-download, + windows-x86-msi-two-download, + minor-one-version, + minor-two-version, + relenv-one-python-version, + relenv-two-python-version, + major-one-version-text, + major-two-version-text ignore_messages=(.*(aix|arista)\.rst.* \(ERROR\/3\) Error in "code-block" directive\:$) diff --git a/README.rst b/README.rst index 82daf74..b320b62 100644 --- a/README.rst +++ b/README.rst @@ -10,10 +10,6 @@ Salt install guide :alt: PyPi Package Downloads :target: https://pypi.org/project/salt -.. image:: https://img.shields.io/twitch/status/saltprojectoss - :alt: Salt Project Twitch Channel - :target: https://www.twitch.tv/saltprojectoss - .. image:: https://img.shields.io/reddit/subreddit-subscribers/saltstack?style=social :alt: Salt Project subreddit :target: https://www.reddit.com/r/saltstack/ @@ -27,24 +23,21 @@ Salt install guide If you're looking to install Salt, you've come to the right place! -- `View the Sphinx-built documentation here `__ -- `View the source repo here `__ +- `View the Sphinx-built documentation here `__ +- `View the source repo here `__ About the Salt install guide ============================ The Salt Install Guide supplements and extends the core documentation for the `Salt Project `__. This guide is intended to -help Salt users install ``salt`` in their environment, ultimately superseding -documentation where applicable: - -* Install directions on `docs.saltproject.io `__ +help Salt users install ``salt`` in their environment. Contributions from anyone inside the Salt project community are always welcome. Please read the :ref:`contributing` for more information. The contributing guide can also be found in the source repository: -* `CONTRIBUTING.rst `__ +* `CONTRIBUTING.rst `__ Related links @@ -77,7 +70,7 @@ The following documentation is part of the Salt Project documentation: * `Module documentation `__: The Salt modules and state modules explain the use cases and arguments needed to execute the Salt modules. -* `Salt User Guide `__: +* `Salt User Guide `__: The Salt User Guide supplements and extends the core documentation for the Salt Project. This guide is intended to help Salt users learn about Salt's core concepts and features. It was originally authored by Alan Cugler and @@ -96,8 +89,28 @@ This repository uses the following tools: web. * Sphinx applies the `Furo Theme for Sphinx `__ to render the site. -* The guide is hosted directly on GitLab using the - `GitLab pages `__ feature. -* GitLab handles the - `CI/CD pipeline `__ +* The guide is hosted directly on GitHub using the + `GitHub pages `__ feature. +* GitHub Actions handle the + `CI/CD pipelines `__ for the project. + +Release Process +=============== + +New releases of the ``salt-install-guide`` are required in order to ensure the latest docs changes +make it into ``docs.saltproject.io``, which are collectively published via a private repository +called ``builddocs``. ``builddocs`` will do the following: + +* Downloads the latest tarball builds from GitHub Releases of target docs repos + * ``salt-install-guide`` + * ``salt-user-guide`` +* Build reference docs from ``salt`` repo for supported release versions + +To cut a new release of ``salt-install-guide``: + +* Create and push a new tag via git +* The new tag will trigger a GitHub Action workflow which will create a new release + * The new release will include the latest built tarball! +* Upon completion of a new ``salt-install-guide`` release, a new workflow must be launched + via ``builddocs`` if wanting these changes to be immediately live diff --git a/docs/_templates/sitevars.rst b/docs/_templates/sitevars.rst index ec9667b..d51601d 100644 --- a/docs/_templates/sitevars.rst +++ b/docs/_templates/sitevars.rst @@ -1,39 +1,45 @@ -.. |major-lts-version| replace:: 3006 -.. |major-sts-version| replace:: 3007 -.. |minor-lts-version| replace:: 3006.9 -.. |minor-sts-version| replace:: 3007.1 -.. |minor-lts-version-badge| replace:: :bdg-link-primary:`3006.9 ` -.. |minor-sts-version-badge| replace:: :bdg-link-success:`3007.1 ` - -.. |relenv-lts-python-version| replace:: **Python v3.10.x** -.. |relenv-sts-python-version| replace:: **Python v3.10.x** +.. |major-latest-version| replace:: LATEST_MAJOR +.. |major-one-version| replace:: ONE_MAJOR +.. |major-two-version| replace:: TWO_MAJOR +.. |major-latest-version-text| replace:: LATEST_MAJOR LATEST_SUPPORT_TYPE +.. |major-one-version-text| replace:: ONE_MAJOR ONE_SUPPORT_TYPE +.. |major-two-version-text| replace:: TWO_MAJOR TWO_SUPPORT_TYPE +.. |major-two-version-repo-postfix| replace:: TWO_MAJOR-TWO_LOWER_SUPPORT_TYPE +.. |minor-latest-version| replace:: LATEST_MINOR +.. |minor-one-version| replace:: ONE_MINOR +.. |minor-two-version| replace:: TWO_MINOR +.. |minor-one-version-badge| replace:: :bdg-link-primary:`ONE_MINOR ` +.. |minor-two-version-badge| replace:: :bdg-link-success:`TWO_MINOR ` + +.. |relenv-one-python-version| replace:: **Python vONE_RELENV_PYTHON.x** +.. |relenv-two-python-version| replace:: **Python vTWO_RELENV_PYTHON.x** .. |quickstart-script-path| replace:: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/salt-quick-start.sh .. |quickstart-script-path-windows| replace:: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/salt-quick-start.ps1 .. |windows-vs-buildtools-script| replace:: https://raw.githubusercontent.com/saltstack/salt/master/pkg/windows/install_vs_buildtools.ps1 -.. |release-candidate-version| replace:: RC_RELEASE -.. |bootstrap-release-candidate| replace:: python3 git vRC_RELEASE -.. |pip-install-release-candidate| replace:: pip install salt==RC_RELEASE +.. |release-candidate-version| replace:: RC_FULL_VERSION +.. |bootstrap-release-candidate| replace:: python3 git vRC_FULL_VERSION +.. |pip-install-release-candidate| replace:: pip install salt==RC_FULL_VERSION -.. |macos-amd64-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3006.9/salt-3006.9-py3-x86_64.pkg -.. |macos-arm64-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3006.9/salt-3006.9-py3-arm64.pkg +.. |macos-amd64-one-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/ONE_MINOR/salt-ONE_MINOR-py3-x86_64.pkg +.. |macos-arm64-one-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/ONE_MINOR/salt-ONE_MINOR-py3-arm64.pkg -.. |macos-amd64-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3007.1/salt-3007.1-py3-x86_64.pkg -.. |macos-arm64-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3007.1/salt-3007.1-py3-arm64.pkg +.. |macos-amd64-two-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/TWO_MINOR/salt-TWO_MINOR-py3-x86_64.pkg +.. |macos-arm64-two-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/TWO_MINOR/salt-TWO_MINOR-py3-arm64.pkg -.. |windows-install-exe-example| replace:: Salt-Minion-3006.9-Py3-AMD64-Setup.exe -.. |windows-install-msi-example| replace:: Salt-Minion-3006.9-Py3-AMD64.msi +.. |windows-install-exe-example| replace:: Salt-Minion-ONE_MINOR-Py3-AMD64-Setup.exe +.. |windows-install-msi-example| replace:: Salt-Minion-ONE_MINOR-Py3-AMD64.msi -.. |windows-amd64-exe-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-AMD64-Setup.exe -.. |windows-amd64-msi-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-AMD64.msi -.. |windows-x86-exe-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-x86-Setup.exe -.. |windows-x86-msi-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-x86.msi +.. |windows-amd64-exe-one-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/ONE_MINOR/Salt-Minion-ONE_MINOR-Py3-AMD64-Setup.exe +.. |windows-amd64-msi-one-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/ONE_MINOR/Salt-Minion-ONE_MINOR-Py3-AMD64.msi +.. |windows-x86-exe-one-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/ONE_MINOR/Salt-Minion-ONE_MINOR-Py3-x86-Setup.exe +.. |windows-x86-msi-one-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/ONE_MINOR/Salt-Minion-ONE_MINOR-Py3-x86.msi -.. |windows-amd64-exe-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-AMD64-Setup.exe -.. |windows-amd64-msi-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-AMD64.msi -.. |windows-x86-exe-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-x86-Setup.exe -.. |windows-x86-msi-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-x86.msi +.. |windows-amd64-exe-two-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/TWO_MINOR/Salt-Minion-TWO_MINOR-Py3-AMD64-Setup.exe +.. |windows-amd64-msi-two-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/TWO_MINOR/Salt-Minion-TWO_MINOR-Py3-AMD64.msi +.. |windows-x86-exe-two-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/TWO_MINOR/Salt-Minion-TWO_MINOR-Py3-x86-Setup.exe +.. |windows-x86-msi-two-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/TWO_MINOR/Salt-Minion-TWO_MINOR-Py3-x86.msi .. |windows-release-candidate-amd64-exe-file-name| replace:: TBD .. |windows-release-candidate-amd64-exe-url| replace:: TBD diff --git a/docs/conf.py b/docs/conf.py index 154bd2f..1b1bb93 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,7 @@ import datetime import os -import requests +# import requests from docutils import nodes from docutils.nodes import Element from sphinx.writers.html import HTMLTranslator @@ -93,39 +93,12 @@ def setup(app): ) # Pull release from "release" in sitevars.rst -release = [s for s in site_vars if "|minor-lts-version|" in s][0].split(":: ")[1] +release = [s for s in site_vars if "|minor-one-version|" in s][0].split(":: ")[1] version = release # Grab major version for URL version selector generation current_version = version.split(".")[0] -## -# Furo theme version selector setup -## -# Pull from JSON in GitLab Snippet -""" -supported_versions_json = requests.get( - "https://gitlab.com/saltstack/open/docs/salt-install-guide/-/snippets/2580440/raw/main/supported-versions.json" -) -supported_versions = supported_versions_json.json() -supported_major_versions = [ - full_version.split(".")[0] - for full_version in supported_versions["supported_versions"] -] -supported_major_versions.sort() - -# Build out version menu -latest_version = supported_versions["latest_version"].split(".")[0] -versions = supported_major_versions -url_prefix = "https://docs.saltproject.io/salt/install-guide/en/" -html_context = make_html_context( - url_prefix=url_prefix, - current_version=current_version, - latest_version=latest_version, - versions=versions, -) -""" - # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be @@ -182,7 +155,7 @@ def setup(app): "color-brand-primary": "#66CCF4", "color-brand-content": "#66CCF4", }, - "announcement": 'IMPORTANT ANNOUNCEMENT: repo.saltproject.io has migrated to packages.broadcom.com!
Click here for latest update (2024-11-22)
', + "announcement": 'IMPORTANT ANNOUNCEMENT: repo.saltproject.io has migrated to packages.broadcom.com!
Click here for migration FAQs (2024-11-22)
', } # Add any paths that contain custom static files (such as style sheets) here, diff --git a/docs/requirements.txt b/docs/requirements.txt index 7bb51cc..f91cb4a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,4 @@ furo>=2024.8.6 -requests>=2.31.0 sphinx-copybutton>=0.5.2 sphinx-design>=0.5.0 sphinx-inline-tabs>=2023.4.21 diff --git a/docs/sitevars.rst b/docs/sitevars.rst deleted file mode 100644 index ec9667b..0000000 --- a/docs/sitevars.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. |major-lts-version| replace:: 3006 -.. |major-sts-version| replace:: 3007 -.. |minor-lts-version| replace:: 3006.9 -.. |minor-sts-version| replace:: 3007.1 -.. |minor-lts-version-badge| replace:: :bdg-link-primary:`3006.9 ` -.. |minor-sts-version-badge| replace:: :bdg-link-success:`3007.1 ` - -.. |relenv-lts-python-version| replace:: **Python v3.10.x** -.. |relenv-sts-python-version| replace:: **Python v3.10.x** - -.. |quickstart-script-path| replace:: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/salt-quick-start.sh -.. |quickstart-script-path-windows| replace:: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/salt-quick-start.ps1 -.. |windows-vs-buildtools-script| replace:: https://raw.githubusercontent.com/saltstack/salt/master/pkg/windows/install_vs_buildtools.ps1 - -.. |release-candidate-version| replace:: RC_RELEASE -.. |bootstrap-release-candidate| replace:: python3 git vRC_RELEASE -.. |pip-install-release-candidate| replace:: pip install salt==RC_RELEASE - -.. |macos-amd64-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3006.9/salt-3006.9-py3-x86_64.pkg -.. |macos-arm64-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3006.9/salt-3006.9-py3-arm64.pkg - -.. |macos-amd64-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3007.1/salt-3007.1-py3-x86_64.pkg -.. |macos-arm64-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/macos/3007.1/salt-3007.1-py3-arm64.pkg - -.. |windows-install-exe-example| replace:: Salt-Minion-3006.9-Py3-AMD64-Setup.exe -.. |windows-install-msi-example| replace:: Salt-Minion-3006.9-Py3-AMD64.msi - -.. |windows-amd64-exe-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-AMD64-Setup.exe -.. |windows-amd64-msi-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-AMD64.msi -.. |windows-x86-exe-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-x86-Setup.exe -.. |windows-x86-msi-lts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3006.9/Salt-Minion-3006.9-Py3-x86.msi - -.. |windows-amd64-exe-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-AMD64-Setup.exe -.. |windows-amd64-msi-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-AMD64.msi -.. |windows-x86-exe-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-x86-Setup.exe -.. |windows-x86-msi-sts-download| replace:: https://packages.broadcom.com/artifactory/saltproject-generic/windows/3007.1/Salt-Minion-3007.1-Py3-x86.msi - -.. |windows-release-candidate-amd64-exe-file-name| replace:: TBD -.. |windows-release-candidate-amd64-exe-url| replace:: TBD -.. |windows-release-candidate-amd64-msi-url| replace:: TBD -.. |windows-release-candidate-x86-exe-url| replace:: TBD -.. |windows-release-candidate-x86-msi-url| replace:: TBD diff --git a/docs/topics/_includes/macos-downloads.rst b/docs/topics/_includes/macos-downloads.rst index 95638d3..d5a94dd 100644 --- a/docs/topics/_includes/macos-downloads.rst +++ b/docs/topics/_includes/macos-downloads.rst @@ -1,5 +1,5 @@ -3006 LTS Downloads ------------------- +|major-one-version-text| Downloads +---------------------------------- .. list-table:: :widths: 10 10 40 @@ -12,14 +12,14 @@ * - x86_64 - lts - - |macos-amd64-lts-download| + - |macos-amd64-one-download| * - arm64 - lts - - |macos-arm64-lts-download| + - |macos-arm64-one-download| -3007 STS Downloads ------------------- +|major-two-version-text| Downloads +---------------------------------- .. list-table:: :widths: 10 10 40 @@ -32,8 +32,8 @@ * - x86_64 - sts - - |macos-amd64-sts-download| + - |macos-amd64-two-download| * - arm64 - sts - - |macos-arm64-sts-download| + - |macos-arm64-two-download| diff --git a/docs/topics/_includes/supported-salt-releases-sidebar.rst b/docs/topics/_includes/supported-salt-releases-sidebar.rst index 8b54a63..7805345 100644 --- a/docs/topics/_includes/supported-salt-releases-sidebar.rst +++ b/docs/topics/_includes/supported-salt-releases-sidebar.rst @@ -1,6 +1,6 @@ .. sidebar:: **Supported Salt releases** - |minor-lts-version-badge| |minor-sts-version-badge| + |minor-one-version-badge| |minor-two-version-badge| **See also** diff --git a/docs/topics/_includes/windows-downloads.rst b/docs/topics/_includes/windows-downloads.rst index 41f35a3..dbfc722 100644 --- a/docs/topics/_includes/windows-downloads.rst +++ b/docs/topics/_includes/windows-downloads.rst @@ -1,5 +1,5 @@ -3006 LTS Downloads ------------------- +|major-one-version-text| Downloads +---------------------------------- .. list-table:: :widths: 10 10 15 65 @@ -14,25 +14,25 @@ * - AMD64 - exe - LTS - - |windows-amd64-exe-lts-download| + - |windows-amd64-exe-one-download| * - AMD64 - msi - LTS - - |windows-amd64-msi-lts-download| + - |windows-amd64-msi-one-download| * - x86 - exe - LTS - - |windows-x86-exe-lts-download| + - |windows-x86-exe-one-download| * - x86 - msi - LTS - - |windows-x86-msi-lts-download| + - |windows-x86-msi-one-download| -3007 STS Downloads ------------------- +|major-two-version-text| Downloads +---------------------------------- .. list-table:: :widths: 10 10 15 65 @@ -47,19 +47,19 @@ * - AMD64 - exe - STS - - |windows-amd64-exe-sts-download| + - |windows-amd64-exe-two-download| * - AMD64 - msi - STS - - |windows-amd64-msi-sts-download| + - |windows-amd64-msi-two-download| * - x86 - exe - STS - - |windows-x86-exe-sts-download| + - |windows-x86-exe-two-download| * - x86 - msi - STS - - |windows-x86-msi-sts-download| + - |windows-x86-msi-two-download| diff --git a/docs/topics/access-old-packages.rst b/docs/topics/access-old-packages.rst index 800b3ee..a3948e4 100644 --- a/docs/topics/access-old-packages.rst +++ b/docs/topics/access-old-packages.rst @@ -6,8 +6,8 @@ Access old packages of Salt The current supported versions of Salt are: -* Salt |minor-lts-version| -* Salt |minor-sts-version| +* Salt |minor-one-version| +* Salt |minor-two-version| See :ref:`salt-version-support-lifecycle` for more information about the support policy for older versions. diff --git a/docs/topics/announcements.rst b/docs/topics/announcements.rst index 93ee530..d10af21 100644 --- a/docs/topics/announcements.rst +++ b/docs/topics/announcements.rst @@ -30,20 +30,20 @@ Release announcements ===================== * **July 30, 2024:** `3006.9 `_ is now available. -* **May 22, 2024:** `3007.1 `_ is now available. +* **May 22, 2024:** `3007.1 `_ is now available. * **April 30, 2024:** `3006.8 `_ is now available. -* **March 6, 2024:** `3007.0 `_ is now available. +* **March 6, 2024:** `3007.0 `_ is now available. * **February 21, 2024:** `3006.7 `_ is now available. * **January 31, 2024:** `3006.6 `_ is now available. -* **January 31, 2024:** `3005.5 `_ is now available. +* **January 31, 2024:** `3005.5 `_ is now available. * **December 12, 2023:** `3006.5 `_ is now available. * **October 27, 2023:** `3006.4 `_ is now available. -* **October 27, 2023:** `3005.4 `_ is now available. -* **September 21, 2023:** `3005.3 `_ is now available. +* **October 27, 2023:** `3005.4 `_ is now available. +* **September 21, 2023:** `3005.3 `_ is now available. * **September 7, 2023:** `3006.3 `_ is now available. * **August 10, 2023:** `3006.2 `_ is now available. -* **August 10, 2023:** `3005.2 `_ is now available. +* **August 10, 2023:** `3005.2 `_ is now available. * **May 5, 2023:** `3006.1 `_ is now available. * **April 18, 2023:** `3006.0 `_ is now available. -* **October 4, 2022:** `3005.1 `_ is now available. -* **August 25, 2022:** `3005 `_ is now available. +* **October 4, 2022:** `3005.1 `_ is now available. +* **August 25, 2022:** `3005 `_ is now available. diff --git a/docs/topics/bootstrap.rst b/docs/topics/bootstrap.rst index 1358b3e..63812e4 100644 --- a/docs/topics/bootstrap.rst +++ b/docs/topics/bootstrap.rst @@ -24,7 +24,7 @@ For example: .. parsed-literal:: - bootstrap-salt.sh stable |minor-lts-version| + bootstrap-salt.sh stable |minor-one-version| The source code and reference documentation for the bootstrap scripts are in the ``salt-bootstrap`` repository: diff --git a/docs/topics/downloads.rst b/docs/topics/downloads.rst index 2db72c6..7b11180 100644 --- a/docs/topics/downloads.rst +++ b/docs/topics/downloads.rst @@ -28,7 +28,7 @@ Linux (RPM) :link: https://packages.broadcom.com/artifactory/saltproject-rpm :bdg-primary:`rpm` - |minor-lts-version-badge| + |minor-one-version-badge| .. grid-item-card:: RPM install guide :class-card: sd-border-1 @@ -47,7 +47,7 @@ Linux (DEB) :link: https://packages.broadcom.com/artifactory/saltproject-deb :bdg-primary:`deb` - |minor-lts-version-badge| + |minor-one-version-badge| .. grid-item-card:: DEB install guide :class-card: sd-border-1 @@ -71,7 +71,7 @@ Download the macOS package and run the file to install Salt. See the :link: https://packages.broadcom.com/artifactory/saltproject-generic/macos :bdg-danger:`macOS` - |minor-lts-version-badge| + |minor-one-version-badge| .. grid-item-card:: macOS install guide :class-card: sd-border-1 @@ -96,7 +96,7 @@ Download the Windows package and run the file to install Salt. See the :link: https://packages.broadcom.com/artifactory/saltproject-generic/windows :bdg-danger:`Windows` - |minor-lts-version-badge| + |minor-one-version-badge| .. grid-item-card:: Windows install guide :class-card: sd-border-1 diff --git a/docs/topics/install-by-operating-system/linux-deb.rst b/docs/topics/install-by-operating-system/linux-deb.rst index 0ede1a7..f2e7dea 100644 --- a/docs/topics/install-by-operating-system/linux-deb.rst +++ b/docs/topics/install-by-operating-system/linux-deb.rst @@ -29,16 +29,20 @@ Install Salt DEBs #. Install the salt-minion, salt-master, or other Salt components: + .. warning:: STS not recommended for Production + + Salt Project recommends deploying LTS releases for Production environments. + .. tab-set:: - .. tab-item:: 3006 LTS + .. tab-item:: |major-one-version-text| - Populate ``/etc/apt/preferences.d/salt-pin-1001`` in order to restrict upgrades to Salt 3006.x LTS: + Populate ``/etc/apt/preferences.d/salt-pin-1001`` in order to restrict upgrades to Salt |major-one-version-text|: - .. code-block:: bash + .. parsed-literal:: echo 'Package: salt-* - Pin: version 3006.* + Pin: version |major-one-version|.* Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/salt-pin-1001 Available installs: @@ -55,15 +59,15 @@ Install Salt DEBs If wanting to install by a target point release, append the specific Salt full release version. For example: - .. code-block:: bash + .. parsed-literal:: - sudo apt-get install salt-common=3006.9 - sudo apt-get install salt-master=3006.9 - sudo apt-get install salt-minion=3006.9 - sudo apt-get install salt-ssh=3006.9 - sudo apt-get install salt-syndic=3006.9 - sudo apt-get install salt-cloud=3006.9 - sudo apt-get install salt-api=3006.9 + sudo apt-get install salt-common=\ |minor-one-version| + sudo apt-get install salt-master=\ |minor-one-version| + sudo apt-get install salt-minion=\ |minor-one-version| + sudo apt-get install salt-ssh=\ |minor-one-version| + sudo apt-get install salt-syndic=\ |minor-one-version| + sudo apt-get install salt-cloud=\ |minor-one-version| + sudo apt-get install salt-api=\ |minor-one-version| .. code-block:: bash @@ -80,25 +84,21 @@ Install Salt DEBs If going with a non-latest point release of a target major version, you may be required to install other salt packages in a pinned fashion. For example, to install - ``salt-minion=3006.8``, a user will be required to install ``salt-common`` at the same version: - - .. code-block:: bash + ``salt-minion``, a user will be required to install ``salt-common`` at the same version: - sudo apt-get install salt-minion=3006.8 salt-common=3006.8 + .. parsed-literal:: + sudo apt-get install salt-minion=\ |minor-one-version| salt-common=\ |minor-one-version| - .. tab-item:: 3007 STS - .. warning:: STS not recommended for Production + .. tab-item:: |major-two-version-text| - Salt Project recommends deploying LTS releases for Production environments. + Populate ``/etc/apt/preferences.d/salt-pin-1001`` in order to restrict upgrades to Salt |major-two-version-text|: - Populate ``/etc/apt/preferences.d/salt-pin-1001`` in order to restrict upgrades to Salt 3007.x STS: - - .. code-block:: bash + .. parsed-literal:: echo 'Package: salt-* - Pin: version 3007.* + Pin: version |major-two-version|.* Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/salt-pin-1001 Available installs: @@ -115,15 +115,15 @@ Install Salt DEBs If wanting to install by a target point release, append the specific Salt full release version. For example: - .. code-block:: bash + .. parsed-literal:: - sudo apt-get install salt-common=3007.1 - sudo apt-get install salt-master=3007.1 - sudo apt-get install salt-minion=3007.1 - sudo apt-get install salt-ssh=3007.1 - sudo apt-get install salt-syndic=3007.1 - sudo apt-get install salt-cloud=3007.1 - sudo apt-get install salt-api=3007.1 + sudo apt-get install salt-common=\ |minor-two-version| + sudo apt-get install salt-master=\ |minor-two-version| + sudo apt-get install salt-minion=\ |minor-two-version| + sudo apt-get install salt-ssh=\ |minor-two-version| + sudo apt-get install salt-syndic=\ |minor-two-version| + sudo apt-get install salt-cloud=\ |minor-two-version| + sudo apt-get install salt-api=\ |minor-two-version| .. code-block:: bash @@ -140,19 +140,15 @@ Install Salt DEBs If going with a non-latest point release of a target major version, you may be required to install other salt packages in a pinned fashion. For example, to install - ``salt-minion=3007.0``, a user will be required to install ``salt-common`` at the same version: + ``salt-minion``, a user will be required to install ``salt-common`` at the same version: - .. code-block:: bash + .. parsed-literal:: - sudo apt-get install salt-minion==3007.0 salt-common==3007.0 + sudo apt-get install salt-minion=\ |minor-two-version| salt-common=\ |minor-two-version| .. tab-item:: LATEST Available - .. warning:: STS not recommended for Production - - Salt Project recommends deploying LTS releases for Production environments. - If users would like to leave installs to come from either LTS or STS, whichever major version is latest. @@ -170,15 +166,15 @@ Install Salt DEBs If wanting to install by a target point release, append the specific Salt full release version. For example: - .. code-block:: bash + .. parsed-literal:: - sudo apt-get install salt-common=3007.1 - sudo apt-get install salt-master=3007.1 - sudo apt-get install salt-minion=3007.1 - sudo apt-get install salt-ssh=3007.1 - sudo apt-get install salt-syndic=3007.1 - sudo apt-get install salt-cloud=3007.1 - sudo apt-get install salt-api=3007.1 + sudo apt-get install salt-common=\ |minor-latest-version| + sudo apt-get install salt-master=\ |minor-latest-version| + sudo apt-get install salt-minion=\ |minor-latest-version| + sudo apt-get install salt-ssh=\ |minor-latest-version| + sudo apt-get install salt-syndic=\ |minor-latest-version| + sudo apt-get install salt-cloud=\ |minor-latest-version| + sudo apt-get install salt-api=\ |minor-latest-version| .. code-block:: bash @@ -195,11 +191,11 @@ Install Salt DEBs If going with a non-latest point release of a target major version, you may be required to install other salt packages in a pinned fashion. For example, to install - ``salt-minion=3007.0``, a user will be required to install ``salt-common`` at the same version: + ``salt-minion``, a user will be required to install ``salt-common`` at the same version: - .. code-block:: bash + .. parsed-literal:: - sudo apt-get install salt-minion==3007.0 salt-common==3007.0 + sudo apt-get install salt-minion=\ |minor-latest-version| salt-common=\ |minor-latest-version| #. Enable and start the Salt services @@ -226,4 +222,3 @@ Browse the repo :width: 50% :bdg-primary:`deb` - |minor-lts-version-badge| diff --git a/docs/topics/install-by-operating-system/linux-rpm.rst b/docs/topics/install-by-operating-system/linux-rpm.rst index 313eef9..e2e9afa 100644 --- a/docs/topics/install-by-operating-system/linux-rpm.rst +++ b/docs/topics/install-by-operating-system/linux-rpm.rst @@ -52,9 +52,13 @@ Install Salt RPMs #. Install the salt-minion, salt-master, or other Salt components: + .. warning:: STS not recommended for Production + + Salt Project recommends deploying LTS releases for Production environments. + .. tab-set:: - .. tab-item:: 3006 LTS + .. tab-item:: |major-one-version-text| Available installs: @@ -70,14 +74,14 @@ Install Salt RPMs If wanting to install by a target point release, append the specific Salt full release version. For example: - .. code-block:: bash + .. parsed-literal:: - sudo dnf install salt-master-3006.9 - sudo dnf install salt-minion-3006.9 - sudo dnf install salt-ssh-3006.9 - sudo dnf install salt-syndic-3006.9 - sudo dnf install salt-cloud-3006.9 - sudo dnf install salt-api-3006.9 + sudo dnf install salt-master-|minor-one-version| + sudo dnf install salt-minion-|minor-one-version| + sudo dnf install salt-ssh-|minor-one-version| + sudo dnf install salt-syndic-|minor-one-version| + sudo dnf install salt-cloud-|minor-one-version| + sudo dnf install salt-api-|minor-one-version| ``dnf versionlock`` can be used to pin to minor versions, if wanting to be excluded during ``dnf upgrade`` runs on a system. @@ -96,20 +100,16 @@ Install Salt RPMs sudo dnf versionlock add salt-cloud sudo dnf versionlock add salt-api - .. tab-item:: 3007 STS - - .. warning:: STS not recommended for Production - - Salt Project recommends deploying LTS releases for Production environments. + .. tab-item:: |major-two-version-text| - If users would like to restrict their installs to the Salt 3007 STS point releases, - these install steps include enabling Salt 3007 STS release downloads. + If users would like to restrict their installs to the Salt |major-two-version-text| point releases, + these install steps include enabling Salt |major-two-version-text| release downloads. - .. code-block:: bash + .. parsed-literal:: - # Enable the Salt 3007 STS repo + # Enable the Salt |major-two-version-text| repo sudo dnf config-manager --set-disable salt-repo-* - sudo dnf config-manager --set-enabled salt-repo-3007-sts + sudo dnf config-manager --set-enabled salt-repo-|major-two-version-repo-postfix| Available installs: @@ -125,14 +125,14 @@ Install Salt RPMs If wanting to install by a target point release, append the specific Salt full release version. For example: - .. code-block:: bash + .. parsed-literal:: - sudo dnf install salt-master-3007.1 - sudo dnf install salt-minion-3007.1 - sudo dnf install salt-ssh-3007.1 - sudo dnf install salt-syndic-3007.1 - sudo dnf install salt-cloud-3007.1 - sudo dnf install salt-api-3007.1 + sudo dnf install salt-master-|minor-two-version| + sudo dnf install salt-minion-|minor-two-version| + sudo dnf install salt-ssh-|minor-two-version| + sudo dnf install salt-syndic-|minor-two-version| + sudo dnf install salt-cloud-|minor-two-version| + sudo dnf install salt-api-|minor-two-version| ``dnf versionlock`` can be used to pin to minor versions, if wanting to be excluded during ``dnf upgrade`` runs on a system. @@ -153,10 +153,6 @@ Install Salt RPMs .. tab-item:: LATEST Available - .. warning:: STS not recommended for Production - - Salt Project recommends deploying LTS releases for Production environments. - If users would like to leave installs to come from either LTS or STS, whichever major version is latest. @@ -180,14 +176,14 @@ Install Salt RPMs If wanting to install by a target point release, append the specific Salt full release version. For example: - .. code-block:: bash + .. parsed-literal:: - sudo dnf install salt-master-3007.1 - sudo dnf install salt-minion-3007.1 - sudo dnf install salt-ssh-3007.1 - sudo dnf install salt-syndic-3007.1 - sudo dnf install salt-cloud-3007.1 - sudo dnf install salt-api-3007.1 + sudo dnf install salt-master-|minor-latest-version| + sudo dnf install salt-minion-|minor-latest-version| + sudo dnf install salt-ssh-|minor-latest-version| + sudo dnf install salt-syndic-|minor-latest-version| + sudo dnf install salt-cloud-|minor-latest-version| + sudo dnf install salt-api-|minor-latest-version| ``dnf versionlock`` can be used to pin to minor versions, if wanting to be excluded during ``dnf upgrade`` runs on a system. @@ -230,4 +226,3 @@ Browse the repo :width: 50% :bdg-primary:`rpm` - |minor-lts-version-badge| diff --git a/docs/topics/install-by-operating-system/macos.rst b/docs/topics/install-by-operating-system/macos.rst index 60e30a6..7ad350b 100644 --- a/docs/topics/install-by-operating-system/macos.rst +++ b/docs/topics/install-by-operating-system/macos.rst @@ -70,4 +70,3 @@ Browse the repo :width: 50% :bdg-primary:`macOS` - |minor-lts-version-badge| diff --git a/docs/topics/other-install-types/platform-agnostic.rst b/docs/topics/other-install-types/platform-agnostic.rst index 0aefdac..0991570 100644 --- a/docs/topics/other-install-types/platform-agnostic.rst +++ b/docs/topics/other-install-types/platform-agnostic.rst @@ -10,17 +10,21 @@ Platform agnostic installation (pip) About platform agonistic installation ===================================== +.. Warning:: + Installing ``salt`` via ``pip`` only has **reasonable-effort support.**. + For more information, see :ref:`salt-python-version-support` + Salt can be installed in a platform-agnostic way using the Python package installer ``pip`` from `pypi.org `_. -You can use ``pip`` to install other packages that will complement your Salt +You can also use ``pip`` to install other packages that will complement your Salt code. A benefit of using ``pip`` is the ability to install Salt in Python virtual environments and Conda environments. .. Warning:: - If you pip install a library using the salt-pip install method, the Python + If you pip install a library using the ``salt-pip`` install method, the Python package installs into the onedir file location. Any scripts installed by the Python library will not be accessible from the usual system Python paths. Scripts installed by the Python library need to be called directly using the diff --git a/docs/topics/revert-to-previous-version.rst b/docs/topics/revert-to-previous-version.rst index 51a27d4..bbcecc1 100644 --- a/docs/topics/revert-to-previous-version.rst +++ b/docs/topics/revert-to-previous-version.rst @@ -29,42 +29,10 @@ To revert to a previous version of Salt: Example output: - .. code-block:: bash + .. parsed-literal:: minion: - 3006.5 - -#. If needed, first run the following command to restrict to target LTS or STS available packages: - - .. tab-set:: - - .. tab-item:: 3006 LTS - - Populate ``/etc/apt/preferences.d/salt-pin-1001`` in order to restrict upgrades to Salt 3006.x LTS: - - .. code-block:: bash - - echo 'Package: salt-* - Pin: version 3006.* - Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/salt-pin-1001 - - .. include:: _includes/previous-version-note.rst - - .. tab-item:: 3007 STS - - .. warning:: STS not recommended for Production - - Salt Project recommends deploying LTS releases for Production environments. - - Populate ``/etc/apt/preferences.d/salt-pin-1001`` in order to restrict upgrades to Salt 3006.x LTS: - - .. code-block:: bash - - echo 'Package: salt-* - Pin: version 3007.* - Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/salt-pin-1001 - - .. include:: _includes/previous-version-note.rst + |minor-one-version| #. Run the following commands to remove all Salt services: @@ -79,19 +47,7 @@ To revert to a previous version of Salt: apt-get remove salt-cloud apt-get remove salt-api - -#. Run the following commands to update your package manager and install any of - the Salt services as needed: - - .. code-block:: bash - - apt-get update - apt-get install salt-master - apt-get install salt-minion - apt-get install salt-ssh - apt-get install salt-syndic - apt-get install salt-cloud - apt-get install salt-api +#. Refer to the install directions, and restrict to target LTS or STS available packages via :ref:`install-deb` #. Verify the version of Salt you are running to ensure you are on the previous version. For example: @@ -118,38 +74,10 @@ To revert to a previous version of Salt: Example output: - .. code-block:: bash + .. parsed-literal:: minion: - 3006.5 - -#. If needed, first run the following command to restrict to target LTS or STS available packages: - - .. tab-set:: - - .. tab-item:: RHEL 9 - - .. code-block:: bash - - curl -fsSL https://repo.saltproject.io/salt/py3/redhat/9/x86_64/minor/3006.X.repo | sudo tee /etc/yum.repos.d/salt.repo - - .. include:: _includes/previous-version-note.rst - - .. tab-item:: RHEL 8 - - .. code-block:: bash - - curl -fsSL https://repo.saltproject.io/salt/py3/redhat/8/x86_64/minor/3006.X.repo | sudo tee /etc/yum.repos.d/salt.repo - - .. include:: _includes/previous-version-note.rst - - .. tab-item:: RHEL 7 - - .. code-block:: bash - - curl -fsSL https://repo.saltproject.io/salt/py3/redhat/7/x86_64/minor/3006.X.repo | sudo tee /etc/yum.repos.d/salt.repo - - .. include:: _includes/previous-version-note.rst + |minor-one-version| #. Run the following command to change your version of Salt and remove all Salt services: @@ -158,6 +86,8 @@ To revert to a previous version of Salt: dnf remove salt +#. Refer to the install directions, and restrict to target LTS or STS available packages via :ref:`install-rpm` + #. Update your package manager and install any of the Salt services as needed: .. code-block:: bash diff --git a/docs/topics/salt-python-version-support.rst b/docs/topics/salt-python-version-support.rst index a277307..03b5ddd 100644 --- a/docs/topics/salt-python-version-support.rst +++ b/docs/topics/salt-python-version-support.rst @@ -18,8 +18,8 @@ The Salt Project team provides **full support** for the package-installed versio ``relenv`` is currently pinned to the following major Python versions in Salt: -- Salt 3006 LTS: |relenv-lts-python-version| -- Salt 3007 STS: |relenv-sts-python-version| +- Salt |major-one-version-text|: |relenv-one-python-version| +- Salt |major-two-version-text|: |relenv-two-python-version| Reasonable-effort support ========================= diff --git a/docs/topics/upgrade.rst b/docs/topics/upgrade.rst index 217dbf6..3494d5b 100644 --- a/docs/topics/upgrade.rst +++ b/docs/topics/upgrade.rst @@ -87,7 +87,7 @@ To upgrade Salt: - To update Windows or macOS, download the latest installers and run them. See :ref:`install-macos` or :ref:`install-windows` for these downloads. -#. After the repository file is updated, import the |minor-lts-version| GPG key. +#. After the repository file is updated, import the |minor-one-version| GPG key. .. include:: _includes/gpg-keys.rst diff --git a/docs/topics/verify-install.rst b/docs/topics/verify-install.rst index e25b753..afc69a6 100644 --- a/docs/topics/verify-install.rst +++ b/docs/topics/verify-install.rst @@ -42,10 +42,10 @@ After a successful installation of Salt: Example response: - .. code-block:: bash + .. parsed-literal:: minion1: - 3004.2 + |minor-one-version| Next steps diff --git a/noxfile.py b/noxfile.py index 6571cef..0980611 100644 --- a/noxfile.py +++ b/noxfile.py @@ -119,8 +119,8 @@ def docs_versions_update(session): @nox.session(name="docs-html", python="3") @nox.parametrize("clean", [False, True]) -@nox.parametrize("download_versions", [False, True]) -def docs_html(session, clean, download_versions): +@nox.parametrize("gen_sitevars", [False, True]) +def docs_html(session, clean, gen_sitevars): """ Build Sphinx HTML Documentation """ @@ -135,10 +135,10 @@ def docs_html(session, clean, download_versions): install_command = ["--progress-bar=off", "-r", str(requirements_file)] session.install(*install_command, silent=True) - # Pull down latest Salt version manifest and update sitevars, etc. - # if download_versions: - # version_updater_script = Path("tools", "version-updater.py") - # session.run("python", str(version_updater_script), external=True) + # Update sitevars from tools/supported-versions.json manifest + if gen_sitevars: + version_updater_script = Path("tools", "version-updater.py") + session.run("python", str(version_updater_script), external=True) # Run sphinx build_dir = Path("docs", "_build", "html") diff --git a/redirector.html b/redirector.html deleted file mode 100644 index 48f7ea2..0000000 --- a/redirector.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/requirements-dev.txt b/requirements-dev.txt index 3820764..0173cc8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,2 @@ -nox>=2022.8.7 -pre-commit>=2.20.0 +nox>=2024.10.9 +pre-commit>=3.8.0 diff --git a/tools/supported-versions.json b/tools/supported-versions.json new file mode 100644 index 0000000..048e6bd --- /dev/null +++ b/tools/supported-versions.json @@ -0,0 +1,15 @@ +{ + "versions": { + "3006.9": { + "default": true, + "type": "LTS", + "relenv_python": "3.10" + }, + "3007.1": { + "default": false, + "type": "STS", + "relenv_python": "3.10" + } + }, + "release_candidate_version": "3008.0rc1" +} diff --git a/tools/version-updater.py b/tools/version-updater.py index 636dc76..a1e8c84 100644 --- a/tools/version-updater.py +++ b/tools/version-updater.py @@ -5,33 +5,47 @@ from pathlib import Path import json import shutil -import requests -# Download and parse supported salt versions manifest -supported_versions_json = requests.get( - "https://gitlab.com/saltstack/open/docs/salt-install-guide/-/snippets/2580440/raw/main/supported-versions.json" -) -supported_versions = supported_versions_json.json() +# Parse supported salt versions manifest +supported_versions_json = Path("tools", "supported-versions.json") +with open(supported_versions_json, "r") as supported_versions_json_reader: + supported_versions = json.load(supported_versions_json_reader) +supported_minor_versions = list(supported_versions["versions"].keys()) supported_major_versions = [ - full_version.split(".")[0] - for full_version in supported_versions["supported_versions"] + version_entry.split(".")[0] for version_entry in supported_minor_versions ] supported_major_versions.sort(reverse=True) -supported_minor_versions = supported_versions["supported_versions"] supported_minor_versions.sort(reverse=True) +# Discover default install version +non_default = [] +for supported_minor_version in supported_minor_versions: + if supported_versions["versions"][supported_minor_version]["default"]: + default_version = supported_minor_version + else: + non_default.append(supported_minor_version) + # Assign vars LATEST_MAJOR = supported_major_versions[0] -OLD_MAJOR = supported_major_versions[1] +ONE_MAJOR = default_version.split(".")[0] +TWO_MAJOR = non_default[0].split(".")[0] LATEST_MINOR = supported_minor_versions[0] -OLD_MINOR = supported_minor_versions[1] -RC_RELEASE = supported_versions["release_candidate_version"] +ONE_MINOR = default_version +TWO_MINOR = non_default[0] +LATEST_SUPPORT_TYPE = supported_versions["versions"][LATEST_MINOR]["type"] +ONE_SUPPORT_TYPE = supported_versions["versions"][ONE_MINOR]["type"] +TWO_SUPPORT_TYPE = supported_versions["versions"][TWO_MINOR]["type"] +ONE_RELENV_PYTHON = supported_versions["versions"][ONE_MINOR]["relenv_python"] +TWO_RELENV_PYTHON = supported_versions["versions"][TWO_MINOR]["relenv_python"] +RC_FULL_VERSION = supported_versions["release_candidate_version"] # Check if three major versions of salt are currently supported if len(supported_major_versions) > 2: THREE_VERSIONS = True - OLDEST_MAJOR = supported_major_versions[2] - OLDEST_MINOR = supported_minor_versions[2] + THREE_MAJOR = non_default[1].split(".")[0] + THREE_MINOR = non_default[1] + THREE_SUPPORT_TYPE = supported_versions["versions"][THREE_MINOR]["type"] + THREE_RELENV_PYTHON = supported_versions["versions"][THREE_MINOR]["relenv_python"] else: THREE_VERSIONS = False @@ -43,47 +57,32 @@ # Update new sitevars file with open(sitevars_updated_file, "r") as sitevars_updated_file_reader: sitevars_template = sitevars_updated_file_reader.read() - sitevars_template_list = sitevars_template.splitlines() - -# Find CURRENT* vars -for sitevars_line in sitevars_template_list: - if "|current-major-version|" in sitevars_line: - CURRENT_MAJOR = sitevars_line.split(" ")[-1] - break -CURRENT_MINOR = None -for salt_minor_version in supported_minor_versions: - if CURRENT_MAJOR in salt_minor_version: - CURRENT_MINOR = salt_minor_version - break - -# Needed for testing new versions of salt -if CURRENT_MINOR == None: - CURRENT_MINOR = f"{CURRENT_MAJOR}.0" # Replace all var placeholders sitevars_updated = ( sitevars_template.replace("LATEST_MAJOR", LATEST_MAJOR) - .replace("OLD_MAJOR", OLD_MAJOR) + .replace("ONE_MAJOR", ONE_MAJOR) + .replace("TWO_MAJOR", TWO_MAJOR) .replace("LATEST_MINOR", LATEST_MINOR) - .replace("OLD_MINOR", OLD_MINOR) - .replace("RC_RELEASE", RC_RELEASE) - .replace("CURRENT_MAJOR", CURRENT_MAJOR) - .replace("CURRENT_MINOR", CURRENT_MINOR) + .replace("ONE_MINOR", ONE_MINOR) + .replace("TWO_MINOR", TWO_MINOR) + .replace("LATEST_SUPPORT_TYPE", LATEST_SUPPORT_TYPE) + .replace("ONE_SUPPORT_TYPE", ONE_SUPPORT_TYPE) + .replace("TWO_SUPPORT_TYPE", TWO_SUPPORT_TYPE) + .replace("TWO_LOWER_SUPPORT_TYPE", TWO_SUPPORT_TYPE.lower()) + .replace("ONE_RELENV_PYTHON", ONE_RELENV_PYTHON) + .replace("TWO_RELENV_PYTHON", TWO_RELENV_PYTHON) + .replace("RC_FULL_VERSION", RC_FULL_VERSION) ) if THREE_VERSIONS: - sitevars_updated = sitevars_template.replace("OLDEST_MAJOR", OLDEST_MAJOR).replace( - "OLDEST_MINOR", OLDEST_MINOR + sitevars_updated = ( + sitevars_updated.replace("THREE_MAJOR", THREE_MAJOR) + .replace("THREE_MINOR", THREE_MINOR) + .replace("THREE_SUPPORT_TYPE", TWO_SUPPORT_TYPE) + .replace("THREE_RELENV_PYTHON", THREE_RELENV_PYTHON) ) # Write dynamic sitevars file with open(sitevars_updated_file, "w") as sitevars_updated_file_writer: sitevars_updated_file_writer.write(sitevars_updated) - -# Write latest announcements file -latest_announcements = requests.get( - "https://gitlab.com/saltstack/open/docs/salt-install-guide/-/snippets/3722105/raw/main/announcements.rst" -) -announcements_file = Path("docs", "topics", "announcements.rst") -with open(announcements_file, "w") as announcements_updated_file_writer: - announcements_updated_file_writer.write(latest_announcements.text)