Skip to content

Commit

Permalink
Add new build file that creates docker container and builds the code
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofigueiredobisect committed Sep 24, 2024
1 parent 6a069a4 commit 76e5811
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ Open `cpp/demos/ossrf-nmos-api/config/nmos_config.json` and adjust the following
`./build/Debug/cpp/demos/ossrf-nmos-api/ossrf-nmos-api -f ./cpp/demos/ossrf-nmos-api/config/nmos_config.json`


## Build Container and Code simultaneously

./scripts/build-inside-container.sh
3 changes: 2 additions & 1 deletion images/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:22.04

# Versions
ENV CONAN_VERSION=2.4.0
ENV CMAKE_VERSION=3.27.0
ENV CMAKE_VERSION=3.28.4
ENV SSHD_PORT=55555


Expand All @@ -23,6 +23,7 @@ RUN /opt/bisect/scripts/build-tools/install-cmake-x86.sh
RUN apt-get install -y \
vim clang-format rsync gdb gdbserver x11-apps xauth iproute2 build-essential
RUN apt-get install -y libgtk-3-dev ninja-build
ENV PATH="/opt/cmake/bin:${PATH}"

RUN /opt/bisect/scripts/common/add-ssh-server.sh

Expand Down
26 changes: 26 additions & 0 deletions scripts/build-inside-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -eu

SCRIPT_DIR="$(realpath "$(dirname "$0")")"
PROJECT_DIR=${SCRIPT_DIR}/..

docker compose -f ${PROJECT_DIR}/images/docker-compose-x86-development.yml build
docker compose -f ${PROJECT_DIR}/images/docker-compose-x86-development.yml up -d

CONTAINER_NAME="images-ossrf-dev-1"

until docker exec -it $CONTAINER_NAME true > /dev/null 2>&1; do
echo "Waiting for container $CONTAINER_NAME to start..."
sleep 2
done

docker exec -it $CONTAINER_NAME bash -c "
git clone https://github.com/AMWA-TV/nmos-sender-receiver-framework.git
cd nmos-sender-receiver-framework
conan profile detect
./scripts/setup.sh
./scripts/build.sh
"

docker exec -it $CONTAINER_NAME fish -C "cd /home/nmos/nmos-sender-receiver-framework"

0 comments on commit 76e5811

Please sign in to comment.