diff --git a/Dockerfile b/Dockerfile index 0ba4b10e4..d21359a6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG UBUNTU_VERSION=jammy-20230126 +ARG UBUNTU_VERSION=focal FROM ubuntu:$UBUNTU_VERSION AS dependencies diff --git a/localbuild.sh b/localbuild.sh index 70c9533b6..83fa5e990 100644 --- a/localbuild.sh +++ b/localbuild.sh @@ -1,32 +1,39 @@ #!/bin/bash -directory=$(pwd) +# exit on errors +set -e + +dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # install dependencies -$directory/scripts/install_dependencies.sh +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 $directory/ext/ +cd $dir/ext/ ./build.sh -cp $directory/container/wait-for-it.sh /usr/local/bin/ -cp $directory/container/service.sh /usr/local/bin/ +cd $dir/container +cp wait-for-it.sh /usr/local/bin/ +cp service.sh /usr/local/bin/ -cd $directory/container/ ./database.sh ./library.sh ldconfig # build internal components -cd $directory/src/ +cd $dir/src/ ./build.sh release ldconfig -$directory/scripts/deployment_dependencies.sh -# package plugins -cd $directory/src/v2i-hub/ -./package_plugins.sh -$directory/container/setup.sh +$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 -# start -/usr/local/bin/service.sh \ No newline at end of file +# run +cd /var/log/tmx/ +/usr/local/bin/service.sh diff --git a/scripts/deployment_dependencies.sh b/scripts/deployment_dependencies.sh index 5281eb727..14100214c 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 2fa104c86..9709d72ed 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 \ @@ -50,3 +51,14 @@ cd build cmake .. make -j${numCPU} make install + +# install lbrdkafka +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