Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM gradle:jdk8-alpine
EXPOSE 8090/tcp
FROM gradle:6.9.0-jdk11
# Copy app files to container
COPY --chown=gradle:gradle . /CRD/
WORKDIR /CRD/server/
RUN ../gradlew build
CMD ["../gradlew", "bootRun"]
# Set working directory so that all subsequent command runs in this folder
WORKDIR /CRD
# Embed CDS Library
# RUN gradle embedCdsLibrary
# Expose port to access the app
RUN gradle build
EXPOSE 8090
# Command to run our app
CMD gradle bootRun
6 changes: 4 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ FROM gradle:6.9.0-jdk11
# Copy app files to container
COPY --chown=gradle:gradle . /CRD/
# Set working directory so that all subsequent command runs in this folder
WORKDIR /CRD/server/
WORKDIR /CRD
# Embed CDS Library
# RUN gradle embedCdsLibrary
RUN gradle build
# Expose port to access the app
EXPOSE 8090
# Command to run our app
CMD ../dockerRunner.sh
CMD ./dockerRunnerDev.sh

28 changes: 28 additions & 0 deletions dockerRunnerDev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Handle closing application on signal interrupt (ctrl + c)
trap 'kill $CONTINUOUS_BUILD_PID $SERVER_PID; gradle --stop; exit' INT

mkdir logs
# Reset log file content for new application boot
echo "*** Logs for 'gradle installBootDist --continuous' ***" > ./logs/builder.log
echo "*** Logs for 'gradle bootRun' ***" > ./logs/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 ./logs/builder.log & CONTINUOUS_BUILD_PID=$!

# Start server process once initial build finishes
( 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=$!

# Handle application background process exiting
wait $CONTINUOUS_BUILD_PID $SERVER_PID
EXIT_CODE=$?
echo "application exited with exit code $EXIT_CODE..."
2 changes: 2 additions & 0 deletions hooks/post_checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
git clone https://github.com/HL7-DaVinci/CDS-Library.git server/CDS-Library

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change this line to use CDS-Library in the mcode space?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the hooks/post_checkout file is for the DRLS CI/CD pipeline, so we can ignore it since we won't be using that.

5 changes: 5 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

processResources {
from ('CDS-Library') {
into 'CDS-Library'
}
}

dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
Expand Down