diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..b59fc9b0f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +.git +target +build +bin +logs +.gradle +server/.gradle +server/bin +server/build +server/ValueSetCache +operations/build +resources/build diff --git a/.gitignore b/.gitignore index 626e6a9fc..9a2fd3381 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ fabric.properties # Log file *.log +logs/ # BlueJ files *.ctxt @@ -131,7 +132,6 @@ gradle-app.setting # Settings, classpath and bin directories .settings/ -.vscode/ .classpath */.settings */.classpath @@ -148,7 +148,6 @@ gradle-app.setting .classpath .settings/ bin/ -.vscode/ # ignore the embeded CDS Library CDS-Library diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..428157c64 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Debug CRD (Local + Docker)", // gradle bootRun -Pdebug, + "request": "attach", + "hostName": "localhost", + "port": 8091, + } + ] +} \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index f7bba100e..4f3f4a708 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -9,5 +9,6 @@ WORKDIR /CRD RUN gradle build # Expose port to access the app EXPOSE 8090 +EXPOSE 8091 # Command to run our app CMD ./dockerRunnerDev.sh diff --git a/dockerRunner.sh b/dockerRunner.sh deleted file mode 100755 index fc2adb2ac..000000000 --- a/dockerRunner.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Handle closing application on signal interrupt (ctrl + c) -trap 'kill $CONTINUOUS_BUILD_PID $SERVER_PID; gradle --stop; exit' INT - -# Reset log file content for new application boot -echo "*** Logs for 'gradle installBootDist --continuous' ***" > builder.log -echo "*** Logs for 'gradle bootRun' ***" > runner.log - -# Print that the application is starting in watch mode -echo "starting application in watch mode..." - -# Start the continious build listener process -echo "starting continuous build listener..." -gradle build --continuous 2>&1 | tee builder.log & CONTINUOUS_BUILD_PID=$! - -# Start server process once initial build finishes -( while ! grep -m1 'BUILD SUCCESSFUL' < builder.log; do - sleep 15 -done -echo "starting crd server..." -gradle bootRun 2>&1 | tee runner.log ) & SERVER_PID=$! - -# Handle application background process exiting -wait $CONTINUOUS_BUILD_PID $SERVER_PID -EXIT_CODE=$? -echo "application exited with exit code $EXIT_CODE..." \ No newline at end of file diff --git a/dockerRunnerDev.sh b/dockerRunnerDev.sh index 451690a2e..a605a6e87 100755 --- a/dockerRunnerDev.sh +++ b/dockerRunnerDev.sh @@ -19,8 +19,8 @@ gradle build --continuous 2>&1 | tee ./logs/builder.log & CONTINUOUS_BUILD_PID=$ ( while ! grep -m1 'BUILD SUCCESSFUL' < ./logs/builder.log; do sleep 1 done -echo "starting crd server..." -gradle bootRun 2>&1 | tee ./logs/runner.log ) & SERVER_PID=$! +echo "starting crd server in debug mode..." +gradle bootRun -Pdebug | tee ./logs/runner.log ) & SERVER_PID=$! # Handle application background process exiting wait $CONTINUOUS_BUILD_PID $SERVER_PID diff --git a/hooks/post_checkout b/hooks/post_checkout deleted file mode 100644 index 8a8a8ef62..000000000 --- a/hooks/post_checkout +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -git clone https://github.com/HL7-DaVinci/CDS-Library.git server/CDS-Library \ No newline at end of file diff --git a/server/build.gradle b/server/build.gradle index 5ecf3db06..00c860cdc 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -24,6 +24,11 @@ processResources { } } +bootRun { + if (project.hasProperty('debug')) { + jvmArgs=["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8091"] + } +} dependencies { developmentOnly("org.springframework.boot:spring-boot-devtools")