Merge "docs: add variable for current branch"

This commit is contained in:
Zuul 2021-06-09 14:06:45 +00:00 committed by Gerrit Code Review
commit 79a3c47d0f
6 changed files with 59 additions and 23 deletions

View File

@ -26,6 +26,28 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import openstackdocstheme
# -- Kayobe configuration --------------------------------------
# Variables to override
# Smart variable replacements with what we can. The openstackdocstheme has
# no stable interface though. This works with 1.20.
current_series = openstackdocstheme.ext._get_series_name()
if current_series == "latest":
branch = "master"
else:
branch = "stable/{}".format(current_series)
# Substitutions loader
rst_epilog = """
.. |current_release_git_branch_name| replace:: {current_release_git_branch_name}
""".format( # noqa: E501
current_release_git_branch_name=branch,
)
# -- General configuration ---------------------------------------------------- # -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be

View File

@ -21,12 +21,12 @@ Configuration
Clone the `kayobe-config <https://opendev.org/openstack/kayobe-config>`_ Clone the `kayobe-config <https://opendev.org/openstack/kayobe-config>`_
git repository, using the correct branch for the release you are deploying. In git repository, using the correct branch for the release you are deploying. In
this example we will use the ``master`` branch. this example we will use the |current_release_git_branch_name| branch.
.. code-block:: console .. parsed-literal::
cd <base path>/src cd <base path>/src
git clone https://opendev.org/openstack/kayobe-config -b master git clone \https://opendev.org/openstack/kayobe-config.git -b |current_release_git_branch_name|
cd kayobe-config cd kayobe-config
This repository is bare, and needs to be populated. The repository includes an This repository is bare, and needs to be populated. The repository includes an

View File

@ -42,18 +42,22 @@ Overcloud
Preparation Preparation
----------- -----------
Clone the Kayobe repository:: Clone the Kayobe repository:
git clone https://opendev.org/openstack/kayobe.git .. parsed-literal::
git clone \https://opendev.org/openstack/kayobe.git -b |current_release_git_branch_name|
Change the current directory to the Kayobe repository:: Change the current directory to the Kayobe repository::
cd kayobe cd kayobe
Clone the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``:: Clone the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``
mkdir -p config/src .. parsed-literal::
git clone https://opendev.org/openstack/kayobe-config-dev.git config/src/kayobe-config
mkdir -p config/src
git clone \https://opendev.org/openstack/kayobe-config-dev.git config/src/kayobe-config -b |current_release_git_branch_name|
Inspect the Kayobe configuration and make any changes necessary for your Inspect the Kayobe configuration and make any changes necessary for your
environment. environment.
@ -187,18 +191,22 @@ VM.
Preparation Preparation
----------- -----------
Clone the Kayobe repository:: Clone the Kayobe repository:
git clone https://opendev.org/openstack/kayobe.git .. parsed-literal::
git clone \https://opendev.org/openstack/kayobe.git -b |current_release_git_branch_name|
Change to the ``kayobe`` directory:: Change to the ``kayobe`` directory::
cd kayobe cd kayobe
Clone the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``:: Clone the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``:
mkdir -p config/src .. parsed-literal::
git clone https://opendev.org/openstack/kayobe-config-dev.git config/src/kayobe-config
mkdir -p config/src
git clone \https://opendev.org/openstack/kayobe-config-dev.git config/src/kayobe-config -b |current_release_git_branch_name|
Inspect the Kayobe configuration and make any changes necessary for your Inspect the Kayobe configuration and make any changes necessary for your
environment. environment.

View File

@ -44,12 +44,14 @@ Running Unit Tests Locally
========================== ==========================
If you haven't already, the kayobe source code should be pulled directly from If you haven't already, the kayobe source code should be pulled directly from
git:: git:
# from your home or source directory .. parsed-literal::
cd ~
git clone https://opendev.org/openstack/kayobe.git # from your home or source directory
cd kayobe cd ~
git clone \https://opendev.org/openstack/kayobe.git -b |current_release_git_branch_name|
cd kayobe
Running Unit and Style Tests Running Unit and Style Tests
---------------------------- ----------------------------

View File

@ -37,9 +37,11 @@ Later sections in the development guide cover in more detail how to use the
development VM in different configurations. These steps cover bringing up and development VM in different configurations. These steps cover bringing up and
accessing the VM. accessing the VM.
Clone the kayobe repository:: Clone the kayobe repository:
git clone https://opendev.org/openstack/kayobe.git .. parsed-literal::
git clone \https://opendev.org/openstack/kayobe.git -b |current_release_git_branch_name|
Change the current directory to the kayobe repository:: Change the current directory to the kayobe repository::

View File

@ -127,10 +127,12 @@ code repositories and python virtual environments::
$ cd <base_path> $ cd <base_path>
$ mkdir -p src venvs $ mkdir -p src venvs
Next, obtain the Kayobe source code. For example:: Next, obtain the Kayobe source code. For example:
$ cd <base_path>/src .. parsed-literal::
$ git clone https://opendev.org/openstack/kayobe.git
$ cd <base_path>/src
$ git clone \https://opendev.org/openstack/kayobe.git -b |current_release_git_branch_name|
Create a virtualenv for Kayobe:: Create a virtualenv for Kayobe::