@ -10,14 +10,20 @@ help() {
usage: $0
-l --loc [ dir] location of the documentation sources root - required
-t --type [ docusaurus| doxygen| swagger] type of documentation generator to use. - required
-b --branch [ branch] pattern of branch names to deploy - optional
-d --dest [ dir] path to where to put the documentation outputs in your repository' s CodeDoc space - optional !! cannot be absolute !!
EOF
exit 1
}
BRANCH = ""
DEST = ""
while [ " $1 " ] ; do
case " $1 " in
"-b" | "--branch" )
BRANCH = " $2 "
shift 1
; ;
"-d" | "--dest" )
DEST = " $2 "
shift 1
@ -53,6 +59,11 @@ RELATIVE_PATH=$(echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$DEST/" | tr -s "/")
. " $GENERATOR_SCRIPT "
generate " $DOC_DIR " # generates doc using the wanted generator
if [ [ -n $BRANCH && ! $DRONE_BRANCH = ~ $BRANCH ] ] ; then
echo " ignoring deploy step since current branch doesn't match $BRANCH "
exit
fi
SERVER_TARGET = " /usr/share/nginx/html/ $RELATIVE_PATH "
# launches rsync in archive, verbose and compression mode