Skip to content

Commit

Permalink
Merge branch '2.8' into 2.8feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jona42-ui authored Nov 16, 2023
2 parents 245e9a1 + 52392b2 commit cc740fe
Show file tree
Hide file tree
Showing 48 changed files with 1,679 additions and 488 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,21 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout dataexport module
uses: actions/checkout@v2
with:
repository: I-TECH-UW/dataexport
ref: develop
- name: install dataexport module
run: mvn clean install
- name: Checkout OpenELIS-Global2
uses: actions/checkout@v2
with:
repository: ${{github.repository}}
submodules: recursive
- name: Initialize and build submodules
run: |
cd dataexport
mvn clean install
cd ..
- name: Build OpenELIS-Global2
run: mvn clean install

- name: Run OpenELS image
run : docker-compose -f build.docker-compose.yml up -d

- name: Sleep for 3 minutes for OpenELIS to start
run: sleep 3m
shell: bash

- name: check containers
run : docker ps

- name: Show OpenELIS Logs
run : docker-compose logs oe.openelis.org

48 changes: 48 additions & 0 deletions .github/workflows/publish-frontend-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish 3.X Dev FrontEnd Docker image

on:
push:
branches: [ '2.8']
workflow_dispatch:


env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-frontend-dev

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./frontend
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,32 @@ You can find more information on how to set up OpenELIS at our [docs page](http:
[![Publish Docker Image Status](https://github.com/I-TECH-UW/OpenELIS-Global-2/actions/workflows/publish.yml/badge.svg)](https://github.com/I-TECH-UW/OpenELIS-Global-2/actions/workflows/publish.yml)

### Running OpenELIS in Docker
#### Running with published docker images
#### Running with docker compose
docker-compose up -d

#### Building the docker images from source code
#### Building the docker images directly from source code
docker-compose -f build.docker-compose.yml up -d --build

#### Running docker containers With locally compiled Artifacts (ie the War file and local frontend Source files)
1. Clone the Repository

git clone https://github.com/I-TECH-UW/OpenELIS-Global-2.git -b 2.8

2. innitialize and build sub modules

git submodule update --init --recursive
cd OpenELIS-Global-2/dataexport
mvn clean install -DskipTests

3. Build the War file

cd OpenELIS-Global-2
mvn clean install -DskipTests

4. Start the containers to mount the locally compiled artifacts

docker-compose -f dev.docker-compose.yml up -d

#### The Instaces can be accesed at

| Instance | URL | credentials (user : password)|
Expand Down
2 changes: 2 additions & 0 deletions build.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ services:
- certs-vol:/etc/nginx/certs/
- keys-vol:/etc/nginx/keys/
- ./volume/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- default
restart: unless-stopped
depends_on:
- certs
Expand Down
134 changes: 134 additions & 0 deletions dev.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
version: '3.3'
services:
certs:
container_name: oe-certs
image: ghcr.io/i-tech-uw/certgen:main
restart: always
environment:
- KEYSTORE_PW="kspass"
- TRUSTSTORE_PW="tspass"
networks:
- default
volumes:
- key_trust-store-volume:/etc/openelis-global
- keys-vol:/etc/ssl/private/
- certs-vol:/etc/ssl/certs/

database:
container_name: openelisglobal-database
image: postgres:9.5
ports:
- "15432:5432"
restart: always
env_file:
- ./volume/database/database.env
volumes:
# preserves the database between containers
- db-data:/var/lib/postgresql/data
# files here will run on install
- ./volume/database/dbInit:/docker-entrypoint-initdb.d
networks:
- default
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "clinlims", "-U", "clinlims" ]
timeout: 45s
interval: 10s
retries: 10

oe.openelis.org:
container_name: openelisglobal-webapp
image: ghcr.io/i-tech-uw/openelis-global-2:2.8
depends_on:
- database
ports:
- "8080:8080"
- "8443:8443"
restart: always
networks:
default:
ipv4_address: 172.20.1.121

environment:
- DEFAULT_PW=adminADMIN!
- TZ=Africa/Nairobi
# context.xml doesn't seem to be able to pick up environment variables directly, so we are passing them in as CATALINA_OPTS
- CATALINA_OPTS= -Ddatasource.url=jdbc:postgresql://database:5432/clinlims -Ddatasource.username=clinlims
volumes:
- key_trust-store-volume:/etc/openelis-global
- ./volume/plugins/:/var/lib/openelis-global/plugins
- ./volume/tomcat/oe_server.xml:/usr/local/tomcat/conf/server.xml
- ./target/OpenELIS-Global.war:/usr/local/tomcat/webapps/OpenELIS-Global.war
secrets:
- source: datasource.password
- source: common.properties

fhir.openelis.org:
container_name: external-fhir-api
image: hapiproject/hapi:v5.5.1
ports:
- "8081:8080"
- "8444:8443"
networks:
- default
restart: always
environment:
TZ: Africa/Nairobi

JAVA_OPTS: "-Djavax.net.ssl.trustStore=/etc/openelis-global/truststore
-Djavax.net.ssl.trustStorePassword=tspass
-Djavax.net.ssl.trustStoreType=pkcs12
-Djavax.net.ssl.keyStore=/etc/openelis-global/keystore
-Djavax.net.ssl.keyStorePassword=kspass
-Djavax.net.ssl.keyStoreType=pkcs12"

volumes:
- key_trust-store-volume:/etc/openelis-global
- ./volume/tomcat/hapi_server.xml:/usr/local/tomcat/conf/server.xml


frontend.openelis.org:
image: ghcr.io/i-tech-uw/openelis-global-2-frontend-dev:2.8
container_name: openelisglobal-front-end
networks:
- default
volumes:
- './frontend/src:/app/src'
- './frontend/public:/app/public'
environment:
- CHOKIDAR_USEPOLLING=true
tty: true

proxy:
image: nginx:1.15-alpine
container_name: openelisglobal-proxy
ports:
- 80:80
- 443:443
volumes:
- certs-vol:/etc/nginx/certs/
- keys-vol:/etc/nginx/keys/
- ./volume/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- default
restart: unless-stopped
depends_on:
- certs

secrets:
datasource.password:
file: ./volume/properties/datasource.password
common.properties:
file: ./volume/properties/common.properties

networks:
default:
driver: bridge
ipam:
config:
- subnet: 172.20.1.0/24

volumes:
db-data:
key_trust-store-volume:
certs-vol:
keys-vol:
17 changes: 7 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,8 @@ services:
frontend.openelis.org:
image: ghcr.io/i-tech-uw/openelis-global-2-frontend:2.8
container_name: openelisglobal-front-end
# ports:
# - 80:80
networks:
- default
volumes:
- './react-ui/src:/app/src'
- './react-ui/public:/app/public'
environment:
- CHOKIDAR_USEPOLLING=true
tty: true
Expand All @@ -103,12 +98,14 @@ services:
image: nginx:1.15-alpine
container_name: openelisglobal-proxy
ports:
- 80:80
- 443:443
- 80:80
- 443:443
volumes:
- certs-vol:/etc/nginx/certs/
- keys-vol:/etc/nginx/keys/
- ./volume/nginx/nginx-prod.conf:/etc/nginx/nginx.conf:ro
- certs-vol:/etc/nginx/certs/
- keys-vol:/etc/nginx/keys/
- ./volume/nginx/nginx-prod.conf:/etc/nginx/nginx.conf:ro
networks:
- default
restart: unless-stopped
depends_on:
- certs
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/addOrder/AddOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ const AddOrder = (props) => {
const [siteNames, setSiteNames] = useState([]);
const [innitialized, setInnitialized] = useState(false);
const [phoneFormat, setPhoneFormat] = useState("");
const configurationProperties = useContext(ConfigurationContext);
const { configurationProperties } = useContext(ConfigurationContext);
const [departments, setDepartments] = useState([]);


const handleDatePickerChange = (datePicker, date) => {
let obj = null;
switch (datePicker) {
Expand Down Expand Up @@ -246,9 +245,9 @@ const AddOrder = (props) => {
loadDepartments,
);
}
const loadDepartments =(data) => {
const loadDepartments = (data) => {
setDepartments(data);
}
};

function handleLabNo(e) {
setOrderFormValues({
Expand Down Expand Up @@ -308,7 +307,6 @@ const AddOrder = (props) => {
});
}


useEffect(() => {
if (!innitialized) {
setPhoneFormat(configurationProperties.phoneFormat);
Expand All @@ -332,7 +330,6 @@ const AddOrder = (props) => {
if (orderFormValues.sampleOrderItems.requestDate != "") {
setInnitialized(true);
}

}, [orderFormValues]);

function handlePriority(e) {
Expand Down Expand Up @@ -445,7 +442,7 @@ const AddOrder = (props) => {
id={"order_receivedDate"}
labelText={<FormattedMessage id="sample.receivedDate" />}
className="inputDate"
autofillDate={true}
autofillDate={true}
value={orderFormValues.sampleOrderItems.receivedDateForDisplay}
onChange={(date) => handleDatePickerChange("receivedDate", date)}
/>
Expand Down Expand Up @@ -667,7 +664,10 @@ const AddOrder = (props) => {
if (sample.tests.length > 0) {
return (
<div key={index}>
<h4> <FormattedMessage id="label.button.sample" /> {index + 1}</h4>
<h4>
{" "}
<FormattedMessage id="label.button.sample" /> {index + 1}
</h4>
<OrderResultReporting
selectedTests={sample.tests}
reportingNotifications={reportingNotifications}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/addOrder/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const Index = () => {
<FormattedMessage id="save.order.success.msg" />,
NotificationKinds.success,
);
setPage(page + 1);
} else {
showAlertMessage(
<FormattedMessage id="server.error.msg" />,
Expand All @@ -63,7 +64,6 @@ const Index = () => {
};
const handleSubmitOrderForm = (e) => {
e.preventDefault();
setPage(page + 1);
console.log(JSON.stringify(orderFormValues))
postToOpenElisServer(
"/rest/SamplePatientEntry",
Expand Down
Loading

0 comments on commit cc740fe

Please sign in to comment.