Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ mvnw.cmd

# Properties
src/main/environment/1097_local.properties
src/main/environment/common_local.properties
src/main/environment/common_local.properties
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ This service has been tested on Wildfly as the application server.
* Redis
* MySQL Database

## Environment and setup

1. Install dependencies `mvn clean install`
2. You can copy `common_example.properties` to `common_local.properties` and edit the file accordingly. The file is under `src/main/environment` folder.
3. Run the spring server with local configuration `mvn spring-boot:run -DENV_VAR=local`

## Integrations
* RMNCH (Reproductive, Maternal, Newborn, and Child Health)

## Usage
All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details.

50 changes: 44 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<org.projectlombok.version>1.16.18</org.projectlombok.version>
<environment>${ENV_VAR}</environment>
<target-properties>target/classes/application.properties</target-properties>
<source-properties>src/main/environment/common_${environment}.properties</source-properties>
<source-properties>target/classes/common_${environment}.properties</source-properties>
<maven.test.skip>true</maven.test.skip>
<sonar.java.binaries>target</sonar.java.binaries>
</properties>
Expand Down Expand Up @@ -211,16 +211,14 @@
<properties>
<final-name>1097identityapi-v1.0</final-name>
<target-properties>target/classes/application.properties</target-properties>
<source-properties>src/main/environment/1097_${environment}.properties</source-properties>
<source-properties>target/classes/1097_${environment}.properties</source-properties>
</properties>
<build>
<finalName>1097identityapi-v1.0</finalName>
</build>
</profile>
</profiles>



<build>
<finalName>identity-0.0.1</finalName>
<plugins>
Expand Down Expand Up @@ -255,6 +253,32 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>filter-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<delimiters>@</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
<resources>
<resource>
<directory>src/main/environment</directory>
<filtering>true</filtering>
<includes>
<include>common_${environment}.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
Expand All @@ -265,11 +289,11 @@
<goals>
<goal>run</goal>
</goals>
<id>properties-updated</id>
<id>merge-properties</id>
<configuration>
<target>
<echo>
concatinating properties file ${target-properties} and
concatenating properties file ${target-properties} and
${source-properties}
</echo>
<concat destfile="${target-properties}" append="yes"
Expand All @@ -280,6 +304,20 @@
</target>
</configuration>
</execution>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<id>clean-property-files</id>
<configuration>
<tasks>
<delete>
<file file="${source-properties}"/>
</delete>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
5 changes: 5 additions & 0 deletions src/main/environment/1097_ci.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=@env.DATABASE_URL@
spring.datasource.username=@env.DATABASE_USERNAME@
spring.datasource.password=@env.DATABASE_PASSWORD@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
5 changes: 5 additions & 0 deletions src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=@env.DATABASE_URL@
spring.datasource.username=@env.DATABASE_USERNAME@
spring.datasource.password=@env.DATABASE_PASSWORD@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver