Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KH-376: OpenMRS config to be CI validated #239

Closed
wants to merge 4 commits into from
Closed
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
47 changes: 47 additions & 0 deletions .github/workflows/validate-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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/[email protected]
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 }}"
},
{
"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 prod -P validator
17 changes: 17 additions & 0 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>validator</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
Expand Down
59 changes: 59 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,54 @@
<module>prod</module>
</modules>
</profile>
<profile>
<id>validator</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>copy-config</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy todir="${project.build.directory}/validator/configuration">
<fileset dir="${project.build.directory}/${project.artifactId}-${project.version}/distro/configs/openmrs/initializer_config"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- hooking the OpenMRS config validation to the integration-test phase -->
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<id>validate-configurations</id>
<phase>integration-test</phase>
<goals>
<goal>validate-configurations</goal>
</goals>
<configuration>
<sourceDir>
${project.build.directory}/validator/configuration</sourceDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>

<build>
Expand Down Expand Up @@ -105,6 +153,17 @@
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>openmrs-repo</id>
<name>OpenMRS Nexus Repository</name>
<url>https://mavenrepo.openmrs.org/nexus/content/repositories/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<distributionManagement>
<repository>
<name>Mekom Solutions Nexus repo for releases</name>
Expand Down
17 changes: 17 additions & 0 deletions prod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>validator</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand Down
Loading