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
58 changes: 58 additions & 0 deletions .github/workflows/api-gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Api GateWay CI

on:
push:
branches:
- feature/api-gateway
paths:
- "api-gateway/**"
- ".github/workflows/api-gateway.yml"

permissions:
contents: read

jobs:
build-and-push:
name: Build and Push Api gateway
runs-on: ubuntu-latest

defaults:
run:
working-directory: api-gateway

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven

- name: Build Project
run: mvn clean package

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_ASWIN }}
password: ${{ secrets.DOCKER_TOKEN_ASWIN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: aswinrj/api-gateway
tags: |
type=raw,value=latest

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: ./api-gateway
file: ./api-gateway/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
58 changes: 58 additions & 0 deletions .github/workflows/auth-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Auth Service CI

on:
push:
branches:
- feature/auth
paths:
- "auth-service/**"
- ".github/workflows/auth-service.yml"

permissions:
contents: read

jobs:
build-and-push:
name: Build and Push Auth Service
runs-on: ubuntu-latest

defaults:
run:
working-directory: auth-service

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven

- name: Build Project
run: mvn clean package

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_ASWIN }}
password: ${{ secrets.DOCKER_TOKEN_ASWIN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: aswinrj/auth-service
tags: |
type=raw,value=latest

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: ./auth-service
file: ./auth-service/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
58 changes: 58 additions & 0 deletions .github/workflows/discovery-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Discovery Service CI

on:
push:
branches:
- feature/discovery-service
paths:
- "discovery-service/**"
- ".github/workflows/discovery-service.yml"

permissions:
contents: read

jobs:
build-and-push:
name: Build and Push Discovery Service
runs-on: ubuntu-latest

defaults:
run:
working-directory: discovery-service

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven

- name: Build Project
run: mvn clean package

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_ASWIN }}
password: ${{ secrets.DOCKER_TOKEN_ASWIN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: aswinrj/discovery-service
tags: |
type=raw,value=latest

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: ./discovery-service
file: ./discovery-service/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
58 changes: 58 additions & 0 deletions .github/workflows/worker-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Worker Service CI

on:
push:
branches:
- feature/worker-service
paths:
- "worker-service/**"
- ".github/workflows/worker-service.yml"

permissions:
contents: read

jobs:
build-and-push:
name: Build and Push Worker Service
runs-on: ubuntu-latest

defaults:
run:
working-directory: worker-service

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven

- name: Build Project
run: mvn clean package -DskipTests

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_ASWIN }}
password: ${{ secrets.DOCKER_TOKEN_ASWIN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: aswinrj/worker-service
tags: |
type=raw,value=latest

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: ./worker-service
file: ./worker-service/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
28 changes: 14 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ services:
- "1025:1025"
- "8025:8025"

workflow-service:
image: anzyl/workflow-service:v1
container_name: workflow-service
ports:
- "8082:8082"
depends_on:
- db
- discovery-service
networks:
- default
environment:
SPRING_PROFILES_ACTIVE: docker
volumes:
- ./database:/app/database
# workflow-service:
# image: anzyl/workflow-service:v1
# container_name: workflow-service
# ports:
# - "8082:8082"
# depends_on:
# - db
# - discovery-service
# networks:
# - default
# environment:
# SPRING_PROFILES_ACTIVE: docker
# volumes:
# - ./database:/app/database

worker-service:
image: aswinrj/worker-service
Expand Down
49 changes: 49 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#

#################################################################################
# WARNING: Do not store sensitive information in this file, #
# as its contents will be included in the Qodana report. #
#################################################################################
version: "1.0"

#Specify inspection profile for code analysis
profile:
name: qodana.starter

#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>

#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>

projectJDK: "21" #(Applied in CI/CD pipeline)

#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh

#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)

# Quality gate. Will fail the CI/CD pipeline if any condition is not met
# severityThresholds - configures maximum thresholds for different problem severities
# testCoverageThresholds - configures minimum code coverage on a whole project and newly added code
# Code Coverage is available in Ultimate and Ultimate Plus plans
#failureConditions:
# severityThresholds:
# any: 15
# critical: 5
# testCoverageThresholds:
# fresh: 70
# total: 50

#Qodana supports other languages, for example, Python, JavaScript, TypeScript, Go, C#, PHP
#For all supported languages see https://www.jetbrains.com/help/qodana/linters.html
linter: jetbrains/qodana-jvm-community:2025.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
public class WorkerServiceApplication {
Expand All @@ -10,4 +12,5 @@ public static void main(String[] args) {
SpringApplication.run(WorkerServiceApplication.class, args);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public void consume(String message) throws JsonProcessingException {
: objectMapper.writeValueAsString(event.configuration());

WorkerTask task = new WorkerTask(
event.taskExecutionId().toString(),
event.workflowExecutionId().toString(),
event.nodeId().toString(),
event.taskExecutionId(),
event.workflowExecutionId(),
event.nodeId(),
event.nodeType(),
payload
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public String getType() {
public WorkerResult execute(WorkerTask task) {
try {
EmailConfig config = objectMapper.readValue(task.getPayload(), EmailConfig.class);

SimpleMailMessage message = new SimpleMailMessage();
message.setTo(config.to());
message.setSubject(config.subject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public void publishTaskCompleted(WorkerTask task, WorkerResult result) {
);

log.info("Publishing task-completed event for task {}", task.getId());
kafkaTemplate.send(KafkaTopics.TASK_COMPLETED, task.getId(), event);
kafkaTemplate.send(KafkaTopics.TASK_COMPLETED, task.getId().toString(), event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
public class KafkaTopics {
public static final String TASK_COMPLETED = "task-completed";

private KafkaTopics() {
}
private KafkaTopics() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import com.flowforge.worker_service.domain.enums.TaskStatus;

import java.time.LocalDateTime;
import java.util.UUID;

public record TaskCompletedEvent(
String workflowExecutionId,
String taskExecutionId,
String nodeId,
UUID workflowExecutionId,
UUID taskExecutionId,
UUID nodeId,
String nodeType,
TaskStatus status,
boolean success,
Expand Down
Loading
Loading