Add a script to prepare the next cycle

Running tox -eprepare-next-cycle will apply all necessary changes, only
requiring that the user review and commit the changes.

Change-Id: I5f10d901e47a8062c87506fbc3e68f2536a47480
This commit is contained in:
Cyril Roelandt 2023-03-21 14:32:23 +01:00
parent b49c141a23
commit 86d0efcd78
3 changed files with 111 additions and 0 deletions

View File

@ -69,3 +69,13 @@ confidence in the Jenkins result), please execute the following command::
After running ``tox``, the documentation will be available for viewing in HTML
format in the ``doc/build/`` directory. Please do not checkin the generated
HTML files as a part of your commit.
At the start of a new cycle, the right files and directories can be created and modified using the following command:
$ tox -eprepare-next-cycle <cycle>
For instance:
$ tox -eprepare-next-cycle 2023.2
The changes should then be reviewed and committed manually.

96
scripts/prepare-next-cycle.sh Executable file
View File

@ -0,0 +1,96 @@
#!/bin/bash
usage () {
echo "Usage: $(basename $0) VERSION"
exit 1
}
[[ "$#" -ne "1" ]] && usage
sed -i "s|priorities/.*|priorities/$1-priorities|;
/Current/,/specs/{
/specs/ { h; s|specs/.*|specs/$1/*| }
};
/Past/,/specs/{
/specs/{x;p;x }
}" doc/source/index.rst
cat <<EOF > "priorities/$1-priorities.rst"
.. _$1-priorities:
=========================
$1 Project Priorities
=========================
TODO(glance-ptl): fill this in after the PTG
EOF
mkdir -p specs/"$1"/approved/{glance,glance_store,python-glanceclient}
mkdir -p specs/"$1"/implemented
for project in glance glance_store python-glanceclient
do
echo "../../../template.rst" > "specs/$1/approved/$project/template.rst"
echo "../../../spec-lite-template.rst" > "specs/$1/approved/$project/spec-lite-template.rst"
done
cat <<EOF > "specs/$1/index.rst"
=====================
$1 Specifications
=====================
.. toctree::
:glob:
:maxdepth: 1
$1 implemented specs:
.. toctree::
:glob:
:maxdepth: 1
implemented/*
$1 approved (but not implemented) specs:
.. toctree::
:glob:
:maxdepth: 1
approved/*
EOF
cat <<EOF > "specs/$1/approved/index.rst"
==============================
$1 Approved Specifications
==============================
.. toctree::
:glob:
:maxdepth: 1
TODO: fill this in once a new approved spec is added.
EOF
cat <<EOF > "specs/$1/implemented/index.rst"
=================================
$1 Implemented Specifications
=================================
TODO: fill this in once a new implemented spec is added.
EOF

View File

@ -20,3 +20,8 @@ commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
whereto doc/source/_extra/.htaccess doc/test/redirect-tests.txt
[testenv:prepare-next-cycle]
deps =
commands =
{toxinidir}/scripts/prepare-next-cycle.sh {posargs}