Skip to content

Commit

Permalink
Add CI build properties, add pom.xml plugins to tweak build process (P…
Browse files Browse the repository at this point in the history
…SMRI#18)

* Add CI build properties, add pom.xml plugins to tweak build process

* Add propeties file
  • Loading branch information
drtechie authored Oct 19, 2023
1 parent 84b35fa commit 9ad142c
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ target/
#configs
config.service.ts
config.json
*.properties

#other
.springBeans
Expand All @@ -13,6 +12,7 @@ hs_err_pid7608.log
.classpath
/.sts4-cache
/logs
.idea

# Properties
src/main/environment/104_test.properties
src/main/environment/104_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
58 changes: 48 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<final-name>104api-v1.0</final-name>
<environment>${ENV_VAR}</environment>
<target-properties>target/classes/application.properties</target-properties>
<source-properties>src/main/environment/104_${environment}.properties</source-properties>
<source-properties>target/classes/104_${environment}.properties</source-properties>
</properties>

<dependencies>
Expand Down Expand Up @@ -250,31 +250,69 @@
</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>104_${environment}.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>

<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<id>properties-updated</id>
<id>merge-properties</id>
<configuration>
<target>
<echo>concatinating properties file ${target-properties} and
${source-properties}</echo>
<echo>
concatenating properties file ${target-properties} and
${source-properties}
</echo>
<concat destfile="${target-properties}" append="yes"
force="yes">
force="yes">
<fileset file="${source-properties}">
</fileset>
</concat>
</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 Expand Up @@ -309,7 +347,7 @@
<properties>
<final-name>104api-v1.0</final-name>
<target-properties>target/classes/application.properties</target-properties>
<source-properties>src/main/environment/104_${environment}.properties</source-properties>
<source-properties>target/classes/104_${environment}.properties</source-properties>
</properties>
<build>
<finalName>104api-v1.0</finalName>
Expand Down
19 changes: 19 additions & 0 deletions src/main/environment/104_ci.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# local env
# DB Connections
## Primary db
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

secondary.datasource.username=@env.REPORTING_DATABASE_USERNAME@
secondary.datasource.password=@env.REPORTING_DATABASE_PASSWORD@
secondary.datasource.url=@env.REPORTING_DATABASE_URL@
secondary.datasource.driver-class-name=com.mysql.jdbc.Driver

# Common Config
common-url=@env.COMMON_API_BASE_URL@

### Redis IP
spring.redis.host=localhost

File renamed without changes.
File renamed without changes.

0 comments on commit 9ad142c

Please sign in to comment.