Skip to content

Commit

Permalink
Merge branch 'develop' into Add-Menu-service-Test
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 authored Oct 17, 2024
2 parents 1aa65b4 + 8854f5c commit e118a02
Show file tree
Hide file tree
Showing 204 changed files with 6,632 additions and 2,742 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ jobs:
- name: Build OpenELIS-Global2
run: mvn clean install -Dspotless.check.skip=true

21 changes: 11 additions & 10 deletions .github/workflows/frontend-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ on:

env:
DOCKER_NAME: ${{ vars.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}-frontend

jobs:

jobs:
build-prod-frontend-image:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -38,8 +37,7 @@ jobs:
with:
context: ./frontend
file: ./frontend/Dockerfile.prod
push: false

push: false

build-and-run-qa-tests:
runs-on: ubuntu-latest
Expand All @@ -50,12 +48,8 @@ jobs:
repository: ${{github.repository}}
submodules: recursive

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

- name: Sleep for 2 minutes
run: sleep 2m
shell: bash
- name: Run OpenELIS image
run: docker compose -f build.docker-compose.yml up -d --build --wait --wait-timeout 600

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -73,3 +67,10 @@ jobs:
- name: Run Frontend Qa Workflow
run: npx cypress run –headless
working-directory: frontend

- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
# Only show last 100 lines of each
tail: "100"
33 changes: 17 additions & 16 deletions .github/workflows/publish-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,12 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache-test
# cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache-test,mode=max
# cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache,mode=max
build-args: SKIP_SPOTLESS=true

build-and-push-test-image-frontend:
Expand Down Expand Up @@ -186,25 +185,21 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache-test
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache-test,mode=max
# cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache,mode=max

run-e2e-qa:
needs:
[build-and-push-test-image-backend, build-and-push-test-image-frontend]
runs-on: ubuntu-latest
steps:
- name: Sleep for 2 minutes
run: sleep 2m
shell: bash

- name: Checkout OpenELIS-Global2
uses: actions/checkout@v4
with:
repository: ${{github.repository}}

- name: Run OpenELS image
run: docker compose -f test.docker-compose.yml up -d
- name: Run OpenELIS image
run: docker compose -f test.docker-compose.yml up -d --build --wait --wait-timeout 300

- name: Cypress run
uses: cypress-io/github-action@v6
Expand All @@ -214,6 +209,13 @@ jobs:
CYPRESS_STARTUP_WAIT_MILLISECONDS: 300000
CYPRESS_VIDEO: false

- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
# Only show last 100 lines of each
tail: "100"

build-and-push-image-backend:
needs: [run-e2e-qa]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -251,13 +253,12 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache-prod
# cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache-prod,mode=max
cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}:buildcache,mode=max
build-args: SKIP_SPOTLESS=true

build-and-push-image-frontend:
Expand Down Expand Up @@ -300,5 +301,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache-prod
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache-prod,mode=max
cache-from: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_TEST_NAME }}-frontend:buildcache,mode=max
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ RUN groupadd tomcat; \
chmod g-w,o-rwx $CATALINA_HOME/conf/logging.properties; \
chmod g-w,o-rwx $CATALINA_HOME/conf/server.xml; \
chmod g-w,o-rwx $CATALINA_HOME/conf/tomcat-users.xml; \
chmod g-w,o-rwx $CATALINA_HOME/conf/web.xml
chmod g-w,o-rwx $CATALINA_HOME/conf/web.xml; \
mkdir -p /var/lib/openelis-global/logs/; \
chown -R tomcat_admin:tomcat /var/lib/openelis-global/logs/;\
mkdir -p /var/lib/openelis-global/properties/; \
chown -R tomcat_admin:tomcat /var/lib/openelis-global/properties/;


COPY install/openelis_healthcheck.sh /healthcheck.sh
RUN chown tomcat_admin:tomcat /healthcheck.sh; \
Expand Down
16 changes: 13 additions & 3 deletions build.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ services:
networks:
default:
ipv4_address: 172.20.1.121

environment:
- DEFAULT_PW=adminADMIN!
- TZ=Africa/Nairobi
Expand All @@ -64,10 +63,18 @@ services:
secrets:
- source: datasource.password
- source: common.properties
healthcheck:
test: ["CMD", "/healthcheck.sh"]
timeout: 10s
interval: 30s
retries: 3
start_period: 2m

fhir.openelis.org:
container_name: external-fhir-api
image: hapiproject/hapi:v6.6.0-tomcat
build:
context: ./fhir
dockerfile: ./Dockerfile
depends_on:
- database
- certs
Expand Down Expand Up @@ -110,8 +117,11 @@ services:
- CHOKIDAR_USEPOLLING=true
tty: true


proxy:
image: nginx:1.15-alpine
build:
context: ./nginx-proxy
dockerfile: ./Dockerfile
container_name: openelisglobal-proxy
ports:
- 80:80
Expand Down
4 changes: 4 additions & 0 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = defineConfig({
defaultCommandTimeout: 8000,
viewportWidth: 1200,
viewportHeight: 700,
watchForFileChanges: false,
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
Expand All @@ -13,7 +14,10 @@ module.exports = defineConfig({
"cypress/e2e/orderEntity.cy.js",
"cypress/e2e/workplan.cy.js",
"cypress/e2e/nonConform.cy.js",
"cypress/e2e/result.cy.js",
"cypress/e2e/validation.cy.js",
"cypress/e2e/modifyOrder.cy.js",
"cypress/e2e/report.cy.js",
"cypress/e2e/batchOrderEntry.cy.js",
"cypress/e2e/dashboard.cy.js",
];
Expand Down
Loading

0 comments on commit e118a02

Please sign in to comment.