You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

79 lines
1.6 KiB

#!/bin/bash
SERVICE_URL=https://git.swarmlab.io:3000/swarmlab/microservice-debianbuster.git
SERVICE_NAME=microservice-debianbuster
SERVICE_NAME_MENOU=debianbuster
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
SOURCE="$TARGET"
else
DIR="$( dirname "$SOURCE" )"
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
SRPATH="$( dirname "$SOURCE" )"
SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
if [ "$SFPATH" != "$SRPATH" ]; then
RDIR=$SRPATH # relativ path directory
fi
cwdir=$PWD
wdir=$SFPATH
echo $cwdir
echo $wdir
cat << EOF > $wdir/antora.yml
name: swarmlab_${SERVICE_NAME}
title: swarmlab_${SERVICE_NAME}
version: docs
nav:
- modules/ROOT/nav.adoc
EOF
cat << EOF > $wdir/site.yml
site:
title: Swarmlab ${SERVICE_NAME}
url: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs
start_page: swarmlab_${SERVICE_NAME}::index.adoc
content:
sources:
- url: ${SERVICE_URL}
branches: master
start_path: docs
ui:
bundle:
url: https://git.swarmlab.io:3000/docs/docs/raw/branch/master/ui-bundle.zip
snapshot: true
supplemental_files: ./supplemental-ui
asciidoc:
attributes:
:plantuml-server-url: http://www.plantuml.com/plantuml
extensions:
- '@djencks/asciidoctor-mathjax'
- asciidoctor-plantuml
EOF
cat << EOF > $wdir/modules/ROOT/nav.adoc
* xref:index.adoc[${SERVICE_NAME_MENOU}]
EOF