From 35fa22094a30384368921c66f638d782e9054656 Mon Sep 17 00:00:00 2001 From: ICScaryThings Date: Sat, 21 May 2022 15:49:34 -0400 Subject: [PATCH] update build_setup.sh and rename to configure_build to be less annoying on tab completion --- build_setup.sh | 11 ----------- configure_build.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) delete mode 100755 build_setup.sh create mode 100755 configure_build.sh diff --git a/build_setup.sh b/build_setup.sh deleted file mode 100755 index 927c921..0000000 --- a/build_setup.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Setup steps to preform before the actual build - -git submodule init -git submodule update - -cp -r mastodont-c treebird/ -cp treebird/{config.def.h,config.h} -ln -s treebird/config.h . - -echo "Please edit config.h (symlinked for convenience) as needed, then run ./build_container.sh" diff --git a/configure_build.sh b/configure_build.sh new file mode 100755 index 0000000..03d6b70 --- /dev/null +++ b/configure_build.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Setup steps to preform before the actual build +INSTANCE_HOST=${1:-pl.example.com} +TREEBIRD_HOST=${2:-treebird.example.com} +TREEBIRD_PORT=${3:-4008} + +CONFIG_DIR=./configs # user specific config items +mkdir -p $CONFIG_DIR + +git submodule init +git submodule update + +cp -r mastodont-c treebird/ +cp treebird/{config.def.h,config.h} + +ln -s ../treebird/config.h ${CONFIG_DIR} + +sed -i "/config_instance_url/ s/= .*;/= \"https:\\/\\/${INSTANCE_HOST}\\/\\\"/;\ + /config_experimental_lookup/ s/= .*;/= FALSE;/" \ + treebird/config.h + +# Patch nginx config sample +sed "s/unix:.*;/127.0.0.1:${TREEBIRD_PORT};/g;s/treebird.example.com/${TREEBIRD_HOST}/g" \ + treebird/docs/sample/treebird.nginx.conf > ${CONFIG_DIR}/treebird.nginx.conf + +echo "Please edit config.h (symlinked for convenience) as needed, then run ./build_container.sh"