zeus
3 years ago
4 changed files with 102 additions and 13 deletions
@ -0,0 +1,12 @@ |
|||
#!/bin/bash |
|||
|
|||
function libs() |
|||
{ |
|||
if [ "$1" != "" ]; |
|||
then |
|||
COMPREPLY=($(compgen -W "network-scanning help" "${COMP_WORDS[$COMP_CWORD]}")) |
|||
fi |
|||
} |
|||
|
|||
|
|||
complete -F libs ./build.sh |
@ -1,10 +0,0 @@ |
|||
docker stop swarmlab-documentation |
|||
docker container rm swarmlab-documentation |
|||
docker pull hub.swarmlab.io:5480/antora |
|||
|
|||
|
|||
./0-cert.error |
|||
|
|||
docdir="intro" |
|||
build="build-intro.sh" |
|||
docker run -ti --name swarmlab-documentation -v $PWD/$docdir:/antora -v $PWD/supplemental-ui:/antora/supplemental-ui hub.swarmlab.io:5480/antora /bin/sh -c "DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr DOCSEARCH_INDEX_VERSION=latest NODE_PATH=/usr/local/lib/node_modules:\$NODE_PATH exec sh -c '/antora/run/$build'" |
@ -0,0 +1,85 @@ |
|||
#!/bin/bash |
|||
|
|||
repoupdate () |
|||
{ |
|||
echo "" |
|||
echo "--------------" |
|||
echo "Repo update" |
|||
echo "--------------" |
|||
echo "" |
|||
git fetch -q |
|||
git pull -a |
|||
} |
|||
|
|||
usage () |
|||
{ |
|||
echo "" |
|||
echo "--------------" |
|||
echo " Documantation " |
|||
echo "--------------" |
|||
echo "" |
|||
echo " USAGE: ./build.sh [OPTIONS]" |
|||
echo "" |
|||
echo " Examples of [OPTIONS] can be:" |
|||
echo " network-scanning: This tutorial demonstrates some common nmap port scanning scenarios and explains the output. " |
|||
echo "" |
|||
echo " help: show this message" |
|||
echo " ./build.sh help" |
|||
echo "" |
|||
echo " " |
|||
} |
|||
|
|||
create_docs () |
|||
{ |
|||
printf "\\n\\n===> Build docs" |
|||
printf "\\n" |
|||
|
|||
docker stop swarmlab-documentation |
|||
docker container rm swarmlab-documentation |
|||
docker pull hub.swarmlab.io:5480/antora |
|||
|
|||
|
|||
./0-cert.error |
|||
|
|||
docker run -ti --name swarmlab-documentation -v $PWD/$docdir:/antora -v $PWD/supplemental-ui:/antora/supplemental-ui hub.swarmlab.io:5480/antora /bin/sh -c "DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr DOCSEARCH_INDEX_VERSION=latest NODE_PATH=/usr/local/lib/node_modules:\$NODE_PATH exec sh -c '/antora/run/$build'" |
|||
} |
|||
|
|||
COMMAND_CREATE=0 |
|||
build="" |
|||
docdir="" |
|||
|
|||
while [ "$1" != "" ]; |
|||
do |
|||
PARAM=$(echo "$1" | awk -F= '{print $1}') |
|||
VALUE=$(echo "$1" | awk -F= '{print $2}') |
|||
|
|||
case $PARAM in |
|||
help) |
|||
usage |
|||
exit |
|||
;; |
|||
|
|||
network-scanning) |
|||
DESC="network-scanning" ; |
|||
build="build-intro.sh" ; |
|||
docdir="intro" ; |
|||
COMMAND_CREATE=1 |
|||
;; |
|||
|
|||
*) |
|||
echo "ERROR: unknown parameter \"$PARAM\"" |
|||
usage |
|||
exit 1 |
|||
;; |
|||
esac |
|||
shift |
|||
done |
|||
|
|||
|
|||
if [ $COMMAND_CREATE -eq 1 ]; then |
|||
create_docs |
|||
|
|||
else |
|||
repoupdate |
|||
usage |
|||
fi |
Loading…
Reference in new issue