diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml new file mode 100644 index 0000000..6edfdc5 --- /dev/null +++ b/.github/workflows/build_publish.yml @@ -0,0 +1,29 @@ +name: Build & Publish atomfeed-console +on: + push: + branches: + - master + paths-ignore: + - "**.md" + +jobs: + build-atomfeed-console: + name: Build atomfeed-console + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Java 8 + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "8" + # - name: Run Unit Tests + # run: mvn --no-transfer-progress clean test + - name: Install bower + run: npm install -g bower + - name: Package + run: mvn --no-transfer-progress clean package -DskipTests + - uses: actions/upload-artifact@v4 + with: + name: atomfeed-console-SNAPSHOT.jar + path: target/*.jar diff --git a/README.md b/README.md index 7c3c463..9e42627 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Atomfeed Console ================ -[![Build Status](https://travis-ci.org/ICT4H/atomfeed-console.png)](https://travis-ci.org/ICT4H/atomfeed-console) +![Build Status](https://github.com/ICT4H/atomfeed-console/actions/workflows/build_upload.yml/badge.svg) Build ===== diff --git a/package/docker/.appversion b/package/docker/.appversion new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/package/docker/.appversion @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file diff --git a/package/docker/Dockerfile b/package/docker/Dockerfile new file mode 100644 index 0000000..415abe1 --- /dev/null +++ b/package/docker/Dockerfile @@ -0,0 +1,8 @@ +FROM amazoncorretto:8 +COPY package/docker/resources/application.yml.template . +COPY package/docker/resources/start.sh . +COPY package/docker/resources/*.jar . +RUN yum install -y gettext +EXPOSE 9080 +RUN chmod +x start.sh +ENTRYPOINT ["./start.sh"] \ No newline at end of file diff --git a/package/docker/README.md b/package/docker/README.md new file mode 100644 index 0000000..b748b6c --- /dev/null +++ b/package/docker/README.md @@ -0,0 +1,13 @@ +# atomfeed-console + +This directory contains resources for building Docker image for atomfeed-console. The atomfeed-console container is used to show the failed events that happened in an atomfeed client. + +Atomfeed console is is useful when you are facing some sync issues with components like OpenMRS, OpenELIS, Odoo, etc. Issues can be like patients not getting created, orders not getting synced, pacs orders not getting synced etc., + +## Building the image locally +1. Checkout the [atomfeed-console](https://github.com/ICT4H/atomfeed-console) repository. +2. Generate the jar file by running `mvn clean install -DskipTests`. +3. Copy the jar file to `package/docker/resources` +4. Build the docker image `docker build -t atomfeed-console:latest .` from the project root. + +[application.yml.template](package/docker/resources/application.yml.template) contains list of atom feeds that we want to configure in Atomfeed Console. To add/remove the feed sources, update the [list](package/docker/resources/application.yml.template#L4) accordingly. \ No newline at end of file diff --git a/package/docker/resources/application.yml.template b/package/docker/resources/application.yml.template new file mode 100644 index 0000000..27c15e8 --- /dev/null +++ b/package/docker/resources/application.yml.template @@ -0,0 +1,19 @@ +server: + port: 9080 + contextPath: /atomfeed-console +appConfigs: +- + appName: OpenMRS + dbUrl: jdbc:mysql://${OPENMRS_DB_HOST}/openmrs + dbUser: ${OPENMRS_DB_USERNAME} + dbPassword: ${OPENMRS_DB_PASSWORD} +- + appName: OpenERP + dbUrl: jdbc:postgresql://odoodb/odoo + dbUser: ${ODOO_DB_USER} + dbPassword: ${ODOO_DB_PASSWORD} +- + appName: OpenELIS + dbUrl: jdbc:postgresql://openelisdb/clinlims?currentSchema=clinlims + dbUser: ${OPENELIS_DB_USER} + dbPassword: ${OPENELIS_DB_PASSWORD} \ No newline at end of file diff --git a/package/docker/resources/start.sh b/package/docker/resources/start.sh new file mode 100644 index 0000000..73091fc --- /dev/null +++ b/package/docker/resources/start.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +echo "[INFO] Substituting Environment Variables" +envsubst < application.yml.template > application.yml +echo "[INFO] Starting Application" +java -jar *.jar --spring.config.location=appilcation.yml \ No newline at end of file