Tools used by OpenStack Documentation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.1 KiB

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
if [[ $# -ne 1 ]]; then
echo "usage: $0 PROJECT"
echo "PROJECT = something like keystone, glance, or nova"
exit 1
# checks command exist or not
function does_exist {
which $@ > /dev/null 2>&1
local status=$?
if [[ $status -ne 0 ]]; then
echo "error: $1 not installed"
exit 1
does_exist virtualenv
does_exist pip
does_exist git
if [[ ! -e $HOME/.gitconfig ]]; then
echo "note: ~/.gitconfig does not exist"
if [[ ! -e .venv ]]; then
virtualenv -p python2.7 .venv
source .venv/bin/activate
pip install --upgrade openstack-doc-tools
pip install --upgrade pbr
if [[ $project == 'gnocchi' ]]; then
pip install --upgrade ${project}client
pip install --upgrade python-${project}client
# python-openstackclient has plugin interface.
# It needs to install plugin package
# (i.e. python-ironicclient).
if [[ $project == 'openstack' ]]; then
pip install --upgrade python-ironicclient
rm -rf output
mkdir output
openstack-auto-commands --output-dir output $project
if [[ ! -e openstack-manuals ]]; then
git clone git://
cd openstack-manuals
( git remote -v | grep -q gerrit ) || git review -s
git checkout master
git pull
git branch --list $branch && git branch -D $branch
git checkout -b $branch
mv ../output/ch_cli_${project}_commands.xml doc/cli-reference/generated
version=$($project --version 2>&1)
git commit -a -m "Update CLI reference for python-${project}client ${version##* }"