mirror of
https://git.freecumextremist.com/icscarythings/treebird-docker.git
synced 2024-11-10 20:34:12 +00:00
30 lines
941 B
Bash
Executable file
30 lines
941 B
Bash
Executable file
#!/bin/bash
|
|
# 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
|
|
|
|
# apply misc patches to fix compile time bugs
|
|
patch -p1 < patches/*.patch
|
|
|
|
cp -r mastodont-c treebird/
|
|
cp treebird/config.def.h treebird/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 configs/config.h (symlinked for convenience) as needed."
|
|
echo "Then run ./build_container.sh"
|