diff --git a/.gitmodules b/.gitmodules index facde6a2d..7ebe00a4d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,4 +24,8 @@ [submodule "login_server/dependencies/cmake-modules"] path = login_server/dependencies/cmake-modules url = https://github.com/viaduck/cmake-modules.git + +[submodule "community_server/src/protobuf"] + path = community_server/src/protobuf + url = git@github.com:gradido/gradido_protocol.git diff --git a/login_server/Dockerfile.debug b/login_server/Dockerfile.debug index 6fcea2cef..a19ddb3c5 100644 --- a/login_server/Dockerfile.debug +++ b/login_server/Dockerfile.debug @@ -1,72 +1,8 @@ -######################################################################################################### -# debug build preparation -######################################################################################################### - -From conanio/gcc9 as build_debug_preparation -USER root -#RUN apt-get update && \ -# apt-get install -y --no-install-recommends gcc g++ && \ -# apt-get autoclean && \ -# apt-get autoremove && \ -# apt-get clean && \ -# rm -rf /var/lib/apt/lists/* - -ENV DOCKER_WORKDIR="/code" - - -#VOLUME /root/.conan - -RUN mkdir -p ${DOCKER_WORKDIR} -WORKDIR ${DOCKER_WORKDIR} - -COPY ./dependencies ./dependencies -COPY ./conanfile.txt ./conanfile.txt - -RUN cd dependencies/mariadb-connector-c && \ - mkdir build && \ - cd build && \ - cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_SSL=OFF .. - - -RUN mkdir build && \ - cd build && \ - conan install .. --build=missing -s build_type=Debug - -######################################################################################################### -# debug build proto and grpc -######################################################################################################### -From build_debug_preparation as proto_grpc - -ENV DOCKER_WORKDIR="/code" -WORKDIR ${DOCKER_WORKDIR} - -COPY ./CMakeLists.txt . -RUN cd build && \ - cmake -DCMAKE_BUILD_TYPE=Debug .. && \ - make -j${CPU_COUNT} protoc grpc_cpp_plugin - -######################################################################################################### -# parse proto and gettext -######################################################################################################### -From proto_grpc as proto_parse - -ENV DOCKER_WORKDIR="/code" -WORKDIR ${DOCKER_WORKDIR} - -RUN mkdir src && \ - cd src && \ - mkdir cpp -COPY ./src/proto ./src/proto -COPY ./unix_parse_proto.sh . - -RUN chmod +x unix_parse_proto.sh && \ - ./unix_parse_proto.sh - ######################################################################################################### # Build debug ######################################################################################################### -From proto_parse as build_debug +From gradido/login_dependencies:stage2 as build_debug ENV DOCKER_WORKDIR="/code" @@ -77,6 +13,11 @@ COPY ./src/cpp ./src/cpp COPY ./src/LOCALE ./src/LOCALE COPY ./compile_pot.sh . COPY ./files_to_translate.txt . +COPY ./src/proto ./src/proto +COPY ./unix_parse_proto.sh . + +RUN chmod +x unix_parse_proto.sh && \ + ./unix_parse_proto.sh RUN chmod +x compile_pot.sh && \ ./compile_pot.sh diff --git a/login_server/Dockerfiles/Dockerfile.dependencies b/login_server/Dockerfiles/Dockerfile.dependencies new file mode 100644 index 000000000..0194c7c82 --- /dev/null +++ b/login_server/Dockerfiles/Dockerfile.dependencies @@ -0,0 +1,56 @@ +######################################################################################################### +# debug build preparation +######################################################################################################### +From conanio/gcc9 as build_debug_preparation +USER root + +ENV DOCKER_WORKDIR="/code" + +RUN mkdir -p ${DOCKER_WORKDIR} +WORKDIR ${DOCKER_WORKDIR} + +COPY ./dependencies ./dependencies +COPY ./conanfile.txt ./conanfile.txt + + +RUN cd dependencies/mariadb-connector-c && \ + mkdir build && \ + cd build && \ + cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_SSL=OFF .. + + +RUN mkdir build && \ + cd build && \ + conan install .. --build=missing -s build_type=Debug + + +######################################################################################################### +# debug build proto and grpc +######################################################################################################### +From build_debug_preparation as proto_grpc + +ENV DOCKER_WORKDIR="/code" +WORKDIR ${DOCKER_WORKDIR} + +COPY ./CMakeLists.txt . +RUN cd build && \ + cmake -DCMAKE_BUILD_TYPE=Debug .. && \ + make -j${CPU_COUNT} protoc grpc_cpp_plugin + +######################################################################################################### +# parse proto and gettext +######################################################################################################### +From proto_grpc as proto_parse + +ENV DOCKER_WORKDIR="/code" +WORKDIR ${DOCKER_WORKDIR} + +RUN mkdir src && \ + cd src && \ + mkdir cpp +COPY ./src/proto ./src/proto +COPY ./unix_parse_proto.sh . + +RUN chmod +x unix_parse_proto.sh && \ + ./unix_parse_proto.sh + diff --git a/login_server/Dockerfiles/build_and_run.sh b/login_server/Dockerfiles/build_and_run.sh new file mode 100644 index 000000000..09dac6cb5 --- /dev/null +++ b/login_server/Dockerfiles/build_and_run.sh @@ -0,0 +1,13 @@ +#!/bin/bash +./compile_proto.sh +if [ ! -d "./build" ] ; then + mkdir ./build + cd build + conan install .. + cd .. +fi +cd build +cmake .. +make -j$(nproc) Gradido_LoginServer +chmod +x ./bin/Gradido_LoginServer +./bin/Gradido_LoginServer \ No newline at end of file diff --git a/login_server/dependencies/cmake-modules b/login_server/dependencies/cmake-modules index 2cc7eb2da..7304f680b 160000 --- a/login_server/dependencies/cmake-modules +++ b/login_server/dependencies/cmake-modules @@ -1 +1 @@ -Subproject commit 2cc7eb2da5677404565f47eb05d8b087388dfbbe +Subproject commit 7304f680be32915e772466ebddc5b7d3b453abd9