Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Decouple examples from service #129

Merged
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ docker-stop: ## Stop notification and workflow services

JAVA_ARGS = -Dspring.profiles.active=local
run-workflow-service: java-checks ## Run local workflow service
java -jar $(JAVA_ARGS) workflow-service/target/workflow-service-$(VERSION).jar
java -jar $(JAVA_ARGS) \
-Dloader.path=workflow-examples/target/workflow-examples-$(VERSION)-jar-with-dependencies.jar \
workflow-service/target/workflow-service-$(VERSION).jar

run-notification-service: java-checks ## Run local notification service
java -jar $(JAVA_ARGS) notification-service/target/notification-service-$(VERSION).jar
Expand Down
4 changes: 2 additions & 2 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ services:

workflow-service:
build:
context: ../workflow-service
dockerfile: ./Dockerfile
context: ../
dockerfile: ./workflow-service/Dockerfile
container_name: workflow-service
ports:
- 9000:8080
Expand Down
21 changes: 21 additions & 0 deletions workflow-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.framework.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.framework.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.parodos</groupId>
Expand Down Expand Up @@ -112,6 +114,25 @@
<reportFormat>html</reportFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 3 additions & 1 deletion workflow-examples/start_workflow_service.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
java -jar -Dspring.profiles.active=local ../workflow-service/target/workflow-service-1.0.3-SNAPSHOT.jar
java -jar -Dspring.profiles.active=local \
-Dloader.path=../workflow-examples/target/workflow-examples-1.0.3-SNAPSHOT-jar-with-dependencies.jar \
../workflow-service/target/workflow-service-1.0.3-SNAPSHOT.jar
7 changes: 5 additions & 2 deletions workflow-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ FROM registry.access.redhat.com/ubi9/openjdk-11-runtime

WORKDIR /app

COPY target/*.jar ./workflow-service.jar
COPY workflow-service/target/*.jar ./workflow-service.jar
COPY workflow-examples/target/*jar-with-dependencies.jar ./workflow-examples.jar

EXPOSE 8080

CMD ["java", "-jar", "workflow-service.jar"]
ENV SYS_PROPS="-Dloader.path=workflow-examples.jar"

ENTRYPOINT java ${SYS_PROPS} -jar workflow-service.jar
21 changes: 16 additions & 5 deletions workflow-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@
<artifactId>workflow-engine</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
masayag marked this conversation as resolved.
Show resolved Hide resolved
<groupId>dev.parodos</groupId>
<artifactId>workflow-examples</artifactId>
<version>${revision}</version>
</dependency>
<!-- END Parodos Library Dependencies -->
<!-- START Developer Productivity Dependencies -->
<dependency>
Expand Down Expand Up @@ -214,6 +209,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springframework.boot.version}</version>
<configuration>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals>
Expand All @@ -224,4 +222,17 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>local</id>
<dependencies>
<dependency>
<groupId>dev.parodos</groupId>
<artifactId>workflow-examples</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
4 changes: 3 additions & 1 deletion workflow-service/start_workflow_service.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
java -jar -Dspring.profiles.active=local target/workflow-service-1.0.3-SNAPSHOT.jar
java -jar -Dspring.profiles.active=local \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, this is already part of the makefile :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you suggest deleting this script? It also repeats itself under workflow-examples.
And if we maintain that script, it should probably be parameterized with the version instead hard-coding it

-Dloader.path=../workflow-examples/target/workflow-examples-1.0.3-SNAPSHOT-jar-with-dependencies.jar \
target/workflow-service-1.0.3-SNAPSHOT.jar