From 5a67801a7aacf8e6f98e68f8bb465c98c86c0b7f Mon Sep 17 00:00:00 2001 From: jwillmartin Date: Mon, 18 Dec 2023 12:35:43 -0500 Subject: [PATCH] new file: local_build.sh modified: scripts/deployment_dependencies.sh modified: scripts/install_dependencies.sh --- local_build.sh | 37 ++++++++++++++++++++++++++++++ scripts/deployment_dependencies.sh | 4 +++- scripts/install_dependencies.sh | 16 +++++++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 local_build.sh diff --git a/local_build.sh b/local_build.sh new file mode 100644 index 000000000..c7c1ecd67 --- /dev/null +++ b/local_build.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# exit on errors +set -e + +dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +sed -i 's|http://archive.ubuntu.com|http://us.archive.ubuntu.com|g' /etc/apt/sources.list +$dir/scripts/install_dependencies.sh + +# build out ext components +cd $dir/ext/ +./build.sh + +cd $dir/container/ +cp wait-for-it.sh /usr/local/bin/ +cp service.sh /usr/local/bin/ + +./database.sh +./library.sh +ldconfig + +# build internal components +cd $dir/src/ +./build.sh release +ldconfig + +$dir/scripts/deployment_dependencies.sh + +cp $dir/src/tmx/TmxCore/tmxcore.service /lib/systemd/system/ +cp $dir/src/tmx/TmxCore/tmxcore.service /usr/sbin/ +ldconfig + +$dir/container/setup.sh + +cd /var/log/tmx/ +/usr/local/bin/service.sh diff --git a/scripts/deployment_dependencies.sh b/scripts/deployment_dependencies.sh index 5281eb727..d11b9abd1 100755 --- a/scripts/deployment_dependencies.sh +++ b/scripts/deployment_dependencies.sh @@ -3,8 +3,10 @@ # exit on errors set -e +distro=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | tr -d "DISTRIB_CODENAME=") + # add the STOL APT repository -echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository develop main" > /etc/apt/sources.list.d/stol-apt-repository.list +echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${distro} main" > /etc/apt/sources.list.d/stol-apt-repository.list apt-get update diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh index c4ce8727e..42c74832f 100755 --- a/scripts/install_dependencies.sh +++ b/scripts/install_dependencies.sh @@ -3,8 +3,10 @@ # exit on errors set -e +distro=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | tr -d "DISTRIB_CODENAME=") + # add the STOL APT repository -echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository develop main" > /etc/apt/sources.list.d/stol-apt-repository.list +echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${distro} main" > /etc/apt/sources.list.d/stol-apt-repository.list apt-get update @@ -20,7 +22,6 @@ DEPENDENCIES="build-essential \ libjsoncpp-dev \ libmysqlclient-dev \ libmysqlcppconn-dev \ - librdkafka-dev \ libsnmp-dev \ libssl-dev \ libuv1-dev \ @@ -53,3 +54,14 @@ cd build cmake .. make -j${numCPU} make install + +# Install librdkafka from instructions provided here https://github.com/confluentinc/librdkafka/tree/master/packaging/cmake +echo " ------> Install librdkafka..." +cd /tmp +git clone https://github.com/confluentinc/librdkafka.git -b v2.2.0 +cd librdkafka/ +cmake -H. -B_cmake_build +cmake --build _cmake_build +cmake --build _cmake_build --target install +cd ../ +rm -r librdkafka