diff --git a/.github/workflows/smoke/build.sh b/.github/workflows/smoke/build.sh index 71ca9de..2841b8d 100755 --- a/.github/workflows/smoke/build.sh +++ b/.github/workflows/smoke/build.sh @@ -10,7 +10,10 @@ mkdir ./build cp ../../../../nebula . cp ../../../../nebula-cert . - cp ../*.yml . + + HOST="lighthouse1" AM_LIGHTHOUSE=true ../genconfig.sh >lighthouse1.yml + HOST="host2" LIGHTHOUSES="192.168.100.1 172.17.0.2:4242" ../genconfig.sh >host2.yml + HOST="host3" LIGHTHOUSES="192.168.100.1 172.17.0.2:4242" ../genconfig.sh >host3.yml ./nebula-cert ca -name "Smoke Test" ./nebula-cert sign -name "lighthouse1" -ip "192.168.100.1/24" diff --git a/.github/workflows/smoke/genconfig.sh b/.github/workflows/smoke/genconfig.sh new file mode 100755 index 0000000..cc9a3f2 --- /dev/null +++ b/.github/workflows/smoke/genconfig.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +set -e + + +if [ "$STATIC_HOSTS" ] || [ "$LIGHTHOUSES" ] +then + echo "static_host_map:" + echo "$STATIC_HOSTS" | while read -r NEBULA_IP STATIC + do + [ -z "$NEBULA_IP" ] || echo " '$NEBULA_IP': ['$STATIC']" + done + echo "$LIGHTHOUSES" | while read -r NEBULA_IP STATIC + do + [ -z "$NEBULA_IP" ] || echo " '$NEBULA_IP': ['$STATIC']" + done + echo +fi + +lighthouse_hosts() { + if [ "$LIGHTHOUSES" ] + then + echo + echo "$LIGHTHOUSES" | while read -r NEBULA_IP STATIC + do + echo " - '$NEBULA_IP'" + done + else + echo "[]" + fi +} + +cat <