-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
21 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,9 @@ | ||
FROM ubuntu:mantic as BUILD | ||
FROM ubuntu:mantic AS build | ||
ENV PROJECT_NAME=desktop-business-app | ||
|
||
COPY database/ /application/database | ||
|
||
WORKDIR /application | ||
COPY . /application | ||
|
||
RUN /application/dependencies.sh | ||
|
||
RUN cmake -S . -B build && cmake --build build | ||
|
||
RUN /application/bin/${PROJECT_NAME}-tests | ||
|
||
FROM ubuntu:mantic as FINAL | ||
ENV PROJECT_NAME=desktop-business-app | ||
|
||
WORKDIR /application | ||
|
||
COPY /dependencies.sh /application/ | ||
RUN /application/dependencies.sh | ||
|
||
COPY --from=BUILD /application/database /application/database | ||
|
||
COPY --from=BUILD /application/bin/${PROJECT_NAME} /application/bin/${PROJECT_NAME} | ||
COPY --from=BUILD /application/bin/${PROJECT_NAME}-tests /application/bin/${PROJECT_NAME}-tests | ||
RUN /application/dependencies.sh | ||
|
||
ENTRYPOINT /application/bin/${PROJECT_NAME} | ||
WORKDIR /application/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Build the Docker image | ||
docker build -t desktop-business-app . | ||
|
||
# Run the container in the background (detached mode) | ||
docker run -d --name my_running_container -v $(pwd):/application -w /application desktop-business-app tail -f /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Clean the build library | ||
# This script is used to clean the build directory then build the backend and run tests | ||
rm -rf build | ||
|
||
# Exit script on first error | ||
set -e | ||
|
||
# Create the build directory and navigate into it | ||
mkdir build && cd build | ||
|
||
# Configure backend with CMake | ||
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ../modules/backend/ | ||
|
||
# Build the target and install backend libs and headers to own_libraries | ||
cmake --build . --parallel --clean-first -- -j2 | ||
|
||
# go back to main app directory | ||
# cd .. | ||
|
||
# # Check if the build_tests directory does not exist | ||
# if [ ! -d "build_tests" ]; then | ||
# # If it does not exist, create it | ||
# mkdir build_tests | ||
# fi | ||
|
||
# Change directory to build_tests | ||
# cd build_tests | ||
|
||
# # Cclean build_tests directory | ||
# # Check if the current directory is build_tests before removing everything | ||
# if [ $(basename "$PWD") == "build_tests" ]; then | ||
# # Remove everything in the current directory | ||
# rm -rf * | ||
# fi | ||
|
||
# # configure tests target with CMake | ||
# cmake -DCMAKE_BUILD_TYPE=Debug ../modules/tests/ | ||
|
||
# # Build the tests target | ||
# cmake --build . --parallel | ||
ctest --output-on-failure |