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
37 git clone ssh://git@github.com/$SITE_USERNAME/site
39 git submodule update --init --recursive
40 git remote add upstream ssh://git@github.com/FDio/site
43 git merge -m "Publish the Docs" upstream/master
46 VERSION=`source $WS_ROOT/src/scripts/version`
47 VERSION=${VERSION/"~"/"-"}
49 # Create a branch for the commit
50 git checkout -b $VERSION
53 # Copy the files to the appropriate directory
54 SRC_DIR=../docs/_build/html/.
55 if [ "$VPP_BRANCH" == "master" ]
57 TARGET_DIR=./static/docs/vpp/master
58 rm -fr ./static/docs/vpp/master
60 TARGET_DIR=./static/docs/vpp/v$VPP_BRANCH
61 rm -fr ./static/docs/vpp/$TARGET_DIR
62 mkdir -p ./static/docs/vpp/$TARGET_DIR
65 cp -r $SRC_DIR $TARGET_DIR
69 git commit -s -m "Publish docs from VPP $VERSION"
70 git push origin "$VERSION"