Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit aab735b

Browse files
authored
FF-250 Run Shell script before each mvn goal and Intellij Run (#58)
* FF-250 Add StartDB script to maven and run config. * Moved Script, Added mvn exec to all configs.
1 parent 0747914 commit aab735b

11 files changed

+52
-21
lines changed

.github/workflows/featureRelease.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ jobs:
2121
with:
2222
java-version: '11.0.8'
2323
architecture: x64
24-
-
25-
name: Setup database for tests.
26-
run: |
27-
docker create -p 27017:27017 --name FileFighterDB mongo:latest
28-
docker start FileFighterDB
2924
-
3025
name: Build Docker Image
3126
run: mvn spring-boot:build-image -f pom.xml

.github/workflows/latestRelease.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ jobs:
2121
with:
2222
java-version: '11.0.8'
2323
architecture: x64
24-
-
25-
name: Setup database for tests.
26-
run: |
27-
docker create -p 27017:27017 --name FileFighterDB mongo:latest
28-
docker start FileFighterDB
2924
-
3025
name: Build Docker Image
3126
run: mvn spring-boot:build-image -f pom.xml

.github/workflows/stableRelease.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ jobs:
1616
with:
1717
java-version: '11.0.8'
1818
architecture: x64
19-
-
20-
name: Setup database for tests.
21-
run: |
22-
docker create -p 27017:27017 --name FileFighterDB mongo:latest
23-
docker start FileFighterDB
2419
-
2520
name: Build Docker Image
2621
run: mvn spring-boot:build-image -f pom.xml

.github/workflows/tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
with:
2121
java-version: '11.0.8'
2222
architecture: x64
23-
-
24-
name: Setup database for tests.
25-
run: |
26-
docker create -p 27017:27017 --name FileFighterDB mongo:latest
27-
docker start FileFighterDB
2823
-
2924
name: Run Tests and update Sonar (import cert first)
3025
run: |

.run/AllJUnitTests.run.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<option name="TEST_OBJECT" value="package" />
99
<option name="PARAMETERS" value="" />
1010
<method v="2">
11+
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/pom.xml" goal="clean compile" />
1112
<option name="Make" enabled="true" />
1213
</method>
1314
</configuration>

.run/JUnit Tests.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="Run only Unit Tests" type="JUnit" factoryName="JUnit">
2+
<configuration default="false" name="Run Unit Tests" type="JUnit" factoryName="JUnit">
33
<useClassPathOnly />
44
<option name="ALTERNATIVE_JRE_PATH" value="11" />
55
<option name="PACKAGE_NAME" value="" />

.run/RestApplication-dev.run.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<option name="ACTIVE_PROFILES" value="dev" />
66
<option name="ALTERNATIVE_JRE_PATH" />
77
<method v="2">
8+
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/pom.xml" goal="clean compile" />
89
<option name="Make" enabled="true" />
910
</method>
1011
</configuration>

.run/RestApplication-prod.run.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<env name="DB_NAME" value="filefighter,DB_USERNAME=root,DB_PASSWORD=1234,DB_CONTAINER_NAME=FileFighterDB" />
99
</envs>
1010
<method v="2">
11+
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/pom.xml" goal="clean compile" />
1112
<option name="Make" enabled="true" />
1213
</method>
1314
</configuration>

.run/Run Cucumber Tests.run.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<value defaultName="wholeProject" />
1111
</option>
1212
<method v="2">
13+
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/pom.xml" goal="clean compile" />
1314
<option name="Make" enabled="true" />
1415
</method>
1516
</configuration>

pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
<version>1.18.16</version>
5252
</dependency>
5353

54+
<!-- running plugin -->
55+
<dependency>
56+
<groupId>org.codehaus.mojo</groupId>
57+
<artifactId>exec-maven-plugin</artifactId>
58+
<version>3.0.0</version>
59+
</dependency>
60+
61+
<!-- Needed for integration test. -->
5462
<dependency>
5563
<groupId>org.apache.httpcomponents</groupId>
5664
<artifactId>httpclient</artifactId>
@@ -132,6 +140,25 @@
132140
</excludes>
133141
</configuration>
134142
</plugin>
143+
<plugin>
144+
<artifactId>exec-maven-plugin</artifactId>
145+
<version>3.0.0</version>
146+
<groupId>org.codehaus.mojo</groupId>
147+
<executions>
148+
<execution>
149+
<!-- Run our version calculation script -->
150+
<id>Renaming build artifacts</id>
151+
<phase>compile</phase>
152+
<goals>
153+
<goal>exec</goal>
154+
</goals>
155+
<configuration>
156+
<executable>bash</executable>
157+
<commandlineArgs>src/main/resources/startDataBaseDocker.sh</commandlineArgs>
158+
</configuration>
159+
</execution>
160+
</executions>
161+
</plugin>
135162
<plugin>
136163
<groupId>org.sonarsource.scanner.maven</groupId>
137164
<artifactId>sonar-maven-plugin</artifactId>

0 commit comments

Comments
 (0)