diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2019-06-07 14:54:38 +0200 |
---|---|---|
committer | laforge <laforge@gnumonks.org> | 2019-06-18 18:18:08 +0000 |
commit | 3b96cf3bb427f259601af590e77fdf41fb0ba25e (patch) | |
tree | be0f3a0a91c4e2e55cee1e22059f5971063fa3d4 /scripts | |
parent | b40355a58883e2c287d9a20e37f17d9789450632 (diff) |
Add script to regenerate VTY and counter documentation
This script needs access to the VTY interface, so I changed some
remaining config files to bind the VTY interface to 0.0.0.0.
There are a couple of services that do that already.
Related: OS#1700
Change-Id: Ic5cf7f59de0c18d4c5568b89433c2b11db2a72a5
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/regen_doc.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/regen_doc.sh b/scripts/regen_doc.sh new file mode 100755 index 0000000..7c7529f --- /dev/null +++ b/scripts/regen_doc.sh @@ -0,0 +1,43 @@ +#!/bin/sh +x + +. ../jenkins-common.sh + +NAME="$1" +PORT="$2" +COUNTERFILE="$3" +VTYFILE="$4" + +IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}" +if [ -z "$OSMO_INTERACT_VTY" ]; then + OSMO_INTERACT_VTY="osmo-interact-vty.py" +fi + +docker_images_require \ + "$NAME-$IMAGE_SUFFIX" + +network_create 172.18.12.0/24 + +container_create() { + CONTAINERNAME=$1 + IP_ADDR=$2 + + docker run --rm --network ${NET_NAME} --ip ${IP_ADDR} \ + --name ${BUILD_TAG}-${CONTAINERNAME} -d \ + ${REPO_USER}/${CONTAINERNAME} + + +} + +container_create "$NAME-$IMAGE_SUFFIX" 172.18.12.23 + +# Get asciidoc counter info +${OSMO_INTERACT_VTY} \ + -c "enable;show asciidoc counters" -p "$PORT" -H 172.18.12.23 -O "$COUNTERFILE" + +# Get vty reference +${OSMO_INTERACT_VTY} \ + -X -p "$PORT" -H 172.18.12.23 -O "$VTYFILE" + +docker container kill "${BUILD_TAG}-$NAME-$IMAGE_SUFFIX" + +network_remove |