5 # This sccript is used to publish the VPP User documents to
10 # $1: The main site repo user name
11 # $2: The release branch name for example 1908, 1904 etc.
14 if [ ! -d "docs" ]; then
15 echo "This script is meant to be run from the root directory."
19 if [ "$#" -ne 2 ]; then
20 echo "Please specify the site username and branch."
24 # Get the workspace root
27 # Get the VPP branch and username
39 git clone ssh://git@github.com/$SITE_USERNAME/site
41 git submodule update --init --recursive
42 git remote add upstream ssh://git@github.com/FDio/site
45 git merge -m "Publish the Docs" upstream/master
48 VERSION=`source $WS_ROOT/src/scripts/version`
49 VERSION=${VERSION/"~"/"-"}
51 # Copy the files to the appropriate directory
52 SRC_DIR=../docs/_build/html/.
53 if [ "$VPP_BRANCH" == "master" ]
55 TARGET_DIR=./static/docs/vpp/master
58 TARGET_DIR=./static/docs/vpp/v$VPP_BRANCH
62 ln -s $VERSION ./static/docs/vpp/latest
65 # Create a branch for the commit
66 git checkout -b $VERSION
70 cp -r $SRC_DIR $TARGET_DIR
72 # Create the feature list
74 source ./sphinx_venv/bin/activate
75 find . -name FEATURE.yaml | ./src/scripts/fts.py --markdown > site/content/vppProject/vppfeatures/features.md
81 git commit -s -m "Publish docs from VPP $VERSION"
82 git push origin "$VERSION"