From bbbdaca7ab3ef2ec98ace807903a4493bd8427f0 Mon Sep 17 00:00:00 2001 From: Zoheir CHINE Date: Tue, 10 Oct 2023 18:41:27 +0000 Subject: [PATCH 1/4] KH-376: OpenMRS config to be CI validated --- .github/workflows/validate-config.yml | 36 +++++++++++++++++ pom.xml | 57 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/validate-config.yml diff --git a/.github/workflows/validate-config.yml b/.github/workflows/validate-config.yml new file mode 100644 index 00000000..3dcb3632 --- /dev/null +++ b/.github/workflows/validate-config.yml @@ -0,0 +1,36 @@ +name: Build and Publish + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '8' + + - name: Set settings.xml + uses: s4u/maven-settings-action@v2.8.0 + with: + servers: | + [{ + "id": "mks-nexus-private", + "username": "${{ secrets.MEKOM_NEXUS_USERNAME }}", + "password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}" + }, + { + "id": "mks-nexus-private-snapshots", + "username": "${{ secrets.MEKOM_NEXUS_USERNAME }}", + "password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}" + }] + - name: Build and validate distro + run: mvn --batch-mode clean install -P validator \ No newline at end of file diff --git a/pom.xml b/pom.xml index b981fc20..d08ab872 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,52 @@ prod + + validator + + + + maven-antrun-plugin + 1.7 + + + copy-config + pre-integration-test + + + + + + + + + run + + + + + + + org.openmrs.maven.plugins + openmrs-packager-maven-plugin + 1.7.0 + + + validate-configurations + integration-test + + validate-configurations + + + + ${project.build.directory}/configuration + + + + + + + @@ -105,6 +151,17 @@ + + + openmrs-repo + OpenMRS Nexus Repository + https://mavenrepo.openmrs.org/nexus/content/repositories/public + + false + + + + Mekom Solutions Nexus repo for releases From 9ec6b742826de4c0dc4368d4c98e153a118ab477 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 15 Jan 2024 18:45:25 +0300 Subject: [PATCH 2/4] Improve configuration validation setup --- base/pom.xml | 17 +++++++++++ pom.xml | 84 +++++++++++++++++++++++++++------------------------- prod/pom.xml | 17 +++++++++++ 3 files changed, 77 insertions(+), 41 deletions(-) diff --git a/base/pom.xml b/base/pom.xml index 1fe40fcf..7bef7153 100644 --- a/base/pom.xml +++ b/base/pom.xml @@ -24,6 +24,23 @@ 1.0.0-SNAPSHOT + + + + validator + + + + maven-antrun-plugin + + + org.openmrs.maven.plugins + openmrs-packager-maven-plugin + + + + + diff --git a/pom.xml b/pom.xml index d08ab872..56c275eb 100644 --- a/pom.xml +++ b/pom.xml @@ -39,47 +39,49 @@ validator - - - maven-antrun-plugin - 1.7 - - - copy-config - pre-integration-test - - - - - - - - - run - - - - - - - org.openmrs.maven.plugins - openmrs-packager-maven-plugin - 1.7.0 - - - validate-configurations - integration-test - - validate-configurations - - - - ${project.build.directory}/configuration - - - - - + + + + maven-antrun-plugin + 1.7 + + + copy-config + pre-integration-test + + + + + + + + + run + + + + + + + org.openmrs.maven.plugins + openmrs-packager-maven-plugin + 1.7.0 + + + validate-configurations + integration-test + + validate-configurations + + + + ${project.build.directory}/validator/configuration + + + + + + diff --git a/prod/pom.xml b/prod/pom.xml index 41d85a87..cb25e6fd 100644 --- a/prod/pom.xml +++ b/prod/pom.xml @@ -43,6 +43,23 @@ + + + validator + + + + maven-antrun-plugin + + + org.openmrs.maven.plugins + openmrs-packager-maven-plugin + + + + + + From 742db5cb6b29acbfce8f6433702af1e7c759f92b Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 15 Jan 2024 18:47:41 +0300 Subject: [PATCH 3/4] Validate Prodduction distro --- .github/workflows/validate-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-config.yml b/.github/workflows/validate-config.yml index 3dcb3632..9ad42611 100644 --- a/.github/workflows/validate-config.yml +++ b/.github/workflows/validate-config.yml @@ -33,4 +33,4 @@ jobs: "password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}" }] - name: Build and validate distro - run: mvn --batch-mode clean install -P validator \ No newline at end of file + run: mvn --batch-mode clean install -P prod -P validator \ No newline at end of file From 551a4dd428a51ba23e6e8e3984c5f00857e488df Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 15 Jan 2024 18:56:22 +0300 Subject: [PATCH 4/4] Add more required maven settings --- .github/workflows/validate-config.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-config.yml b/.github/workflows/validate-config.yml index 9ad42611..0c59269f 100644 --- a/.github/workflows/validate-config.yml +++ b/.github/workflows/validate-config.yml @@ -22,7 +22,18 @@ jobs: uses: s4u/maven-settings-action@v2.8.0 with: servers: | - [{ + [ + { + "id": "mks-nexus-public", + "username": "${{ secrets.MEKOM_NEXUS_USERNAME }}", + "password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}" + }, + { + "id": "mks-nexus-public-snapshots", + "username": "${{ secrets.MEKOM_NEXUS_USERNAME }}", + "password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}" + }, + { "id": "mks-nexus-private", "username": "${{ secrets.MEKOM_NEXUS_USERNAME }}", "password": "${{ secrets.MEKOM_NEXUS_PASSWORD }}"