let the autohelp_wrapper use local repos
The autohelp_wrapper uses as git URL for the projects the URL git://git.openstack.org/openstack. This is not configurable. Because of that, the build of guides (e.g. the configuration reference) based on local (not yet commited) branches was not possible. This change set offers a new parameter for the script to use another URL for the projects (e.g. to a local one). Example: The command to build the config options table of a local nova branch (with the name "docs_serial_console") which is in the local folder "~/git" would look like this: ./autohelp-wrapper -g ~/git -b docs_serial_console docbook nova Change-Id: I03e5491221ac03be596b243183bdeb98c63dd03e
This commit is contained in:
parent
b455d12bfb
commit
8a8ccdfb8e
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# 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
|
# not use this file except in compliance with the License. You may obtain
|
||||||
# a copy of the License at
|
# a copy of the License at
|
||||||
|
@ -20,7 +20,9 @@ MANUALSREPO=$SOURCESDIR/openstack-manuals
|
||||||
AUTOHELP="python $HERE/autohelp.py"
|
AUTOHELP="python $HERE/autohelp.py"
|
||||||
EXTRACT_SWIFT="python $HERE/extract_swift_flags.py"
|
EXTRACT_SWIFT="python $HERE/extract_swift_flags.py"
|
||||||
GITBASE=git://git.openstack.org/openstack
|
GITBASE=git://git.openstack.org/openstack
|
||||||
|
GITPROJ=git://git.openstack.org/openstack
|
||||||
PROJECTS="ceilometer cinder glance heat ironic keystone neutron nova sahara swift trove"
|
PROJECTS="ceilometer cinder glance heat ironic keystone neutron nova sahara swift trove"
|
||||||
|
MANUALS_PROJECTS="openstack-manuals oslo-incubator"
|
||||||
BRANCH=master
|
BRANCH=master
|
||||||
FAST=0
|
FAST=0
|
||||||
|
|
||||||
|
@ -30,16 +32,18 @@ usage() {
|
||||||
echo " $(basename $0) [ OPTIONS ] update|docbook|setup [ project1 ... ]"
|
echo " $(basename $0) [ OPTIONS ] update|docbook|setup [ project1 ... ]"
|
||||||
echo
|
echo
|
||||||
echo "Subcommands:"
|
echo "Subcommands:"
|
||||||
echo " create: Create an initial flagmapping file"
|
echo " create: Create an initial flagmapping file"
|
||||||
echo " update: Update the flagmapping files"
|
echo " update: Update the flagmapping files"
|
||||||
echo " docbook: Generate the options tables"
|
echo " docbook: Generate the options tables"
|
||||||
echo " setup: Install the environment only"
|
echo " setup: Install the environment only"
|
||||||
echo
|
echo
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -b BRANCH: Work on this branch (defaults to master)"
|
echo " -b BRANCH: Work on this branch (defaults to master)"
|
||||||
echo " -c: Recreate the virtual environment"
|
echo " -g GITPROJ: Use this location for the project git repos "
|
||||||
echo " -f: Work offline: Do not change environment or sources"
|
echo " (defaults to git://git.openstack.org/openstack)"
|
||||||
echo " -e PATH: Create the virtualenv in PATH"
|
echo " -c: Recreate the virtual environment"
|
||||||
|
echo " -f: Work offline: Do not change environment or sources"
|
||||||
|
echo " -e PATH: Create the virtualenv in PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_venv() {
|
setup_venv() {
|
||||||
|
@ -60,9 +64,13 @@ activate_venv() {
|
||||||
|
|
||||||
get_project() {
|
get_project() {
|
||||||
project=$1
|
project=$1
|
||||||
|
git_url=$GITPROJ
|
||||||
|
|
||||||
if [ ! -e $SOURCESDIR/$project ]; then
|
if [ ! -e $SOURCESDIR/$project ]; then
|
||||||
git clone $GITBASE/$project $SOURCESDIR/$project
|
if [[ $MANUALS_PROJECTS =~ (^| )$project($| ) ]]; then
|
||||||
|
git_url=$GITBASE
|
||||||
|
fi
|
||||||
|
git clone $git_url/$project $SOURCESDIR/$project
|
||||||
else
|
else
|
||||||
if [ $project != openstack-manuals ]; then
|
if [ $project != openstack-manuals ]; then
|
||||||
(cd $SOURCESDIR/$project && git pull)
|
(cd $SOURCESDIR/$project && git pull)
|
||||||
|
@ -78,11 +86,14 @@ setup_tools() {
|
||||||
pip install oslo.i18n lxml
|
pip install oslo.i18n lxml
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts :b:e:cf opt; do
|
while getopts :b:g:e:cf opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b)
|
b)
|
||||||
BRANCH=$OPTARG
|
BRANCH=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
g)
|
||||||
|
GITPROJ=$OPTARG
|
||||||
|
;;
|
||||||
c)
|
c)
|
||||||
rm -rf $VENVDIR
|
rm -rf $VENVDIR
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue