Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into main
  • Loading branch information
Conor Flynn committed Oct 31, 2022
2 parents fad1e0f + 4caac1a commit 8094845
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 15 deletions.
42 changes: 28 additions & 14 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name: CI with mvn
on:
push:
branches: [ main ]
paths: 'DeFi-Data-Engine/**'
pull_request:
branches: [ main ]
paths: 'DeFi-Data-Engine/**'
workflow_dispatch:

jobs:
build:
buildandDeployDataEngine:

runs-on: [ self-hosted ]
defaults:
Expand All @@ -16,18 +18,30 @@ jobs:

steps:
- uses: actions/checkout@v3
# - name: Set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn clean compile assembly:single -Dmaven.skip.test=true

# #Deployment will fail if there are deployments which did not come from this workflow
# - name: Check if existing deployments
# run: pkill -f 'java -jar target/defi-data-engine-0.0.1-jar-with-dependencies.jar'

# - run: mvn --batch-mode --update-snapshots verify
# - run: mkdir staging && cp target/*.jar staging
# - uses: actions/upload-artifact@v3
# with:
# name: Package
# path: staging
- name: Deploy data engine
run: RUNNER_TRACKING_ID="" && (java -jar target/defi-data-engine-0.0.1-jar-with-dependencies.jar &)

buildRestAPI:
needs: buildandDeployDataEngine
runs-on: [ self-hosted ]
defaults:
run:
working-directory: "DeFi-Data-Engine/Rest Application/"

steps:
- uses: actions/checkout@v3

- name: Build with Maven
run: mvn clean compile assembly:single -Dmaven.skip.test=true

- name: Deploy rest application
run: RUNNER_TRACKING_ID="" && (java -jar target/rest-connection-4.3.3-jar-with-dependencies.jar &)

28 changes: 27 additions & 1 deletion DeFi-Data-Engine/DeFi Data Engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>DeFiDataEngine</groupId>
<artifactId>defi-data-engine</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<packaging>jar</packaging>

<dependencies>
<dependency>
Expand Down Expand Up @@ -41,6 +41,11 @@
<artifactId>json</artifactId>
<version>20220320</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
</dependencies>

<build>
Expand All @@ -55,7 +60,28 @@
</systemPropertyVariables>
</configuration>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.main.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<java.version>17</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

</project>

13 changes: 13 additions & 0 deletions DeFi-Data-Engine/Rest Application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.rest.application.RestApplication</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 8094845

Please sign in to comment.