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