Skip to content

Commit 63c60e2

Browse files
Merge branch 'main' into mahmoud/users-profile
2 parents 17f5117 + 53fce39 commit 63c60e2

File tree

190 files changed

+8051
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+8051
-831
lines changed

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ jobs:
2727
distribution: 'temurin'
2828
cache: maven
2929
- name: Build with Maven
30-
run: mvn -DskipTests -B compile --file pom.xml
30+
run: mvn -DskipTests -B install --file pom.xml
31+
32+
- name: Check Formatting
33+
run: mvn -DskipTests verify
34+
35+
- name: Check Tests
36+
run: cd services/jobs && mvn test
3137

3238
- name: Submit Dependency Snapshot
3339
uses: advanced-security/maven-dependency-submission-action@v3

.idea/compiler.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mvn/jvm.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ build:
55
docker compose build
66

77
up:
8-
docker compose up
8+
docker compose up --force-recreate
9+
10+
reload:
11+
mvn -DskipTests package
12+
docker compose up --detach --build

compose.yaml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,68 @@ services:
55
# ----- GENERAL SERVICES -------
66
service_mq:
77
image: rabbitmq:3.13-management
8+
healthcheck:
9+
test: rabbitmq-diagnostics -q ping
10+
interval: 30s
11+
timeout: 30s
12+
retries: 3
813
networks:
914
- microservices
1015
ports:
1116
- "5672:5672"
1217
- "15672:15672"
1318

1419
# ----- JOBS MICROSERVICE -------
15-
service_jobs:
20+
service_jobs:
1621
build: ./services/jobs
1722
depends_on:
1823
jobs_db:
1924
condition: service_healthy
2025
service_mq:
21-
condition: service_started
26+
condition: service_healthy
2227
networks:
2328
- microservices
2429
- jobs
25-
30+
31+
# ----- PAYMENTS MICROSERVICE -------
32+
service_payments:
33+
build: ./services/payments
34+
depends_on:
35+
payments_db:
36+
condition: service_healthy
37+
service_mq:
38+
condition: service_started
39+
networks:
40+
- microservices
41+
- payments
42+
2643
jobs_db:
2744
image: cassandra:4.0.7
2845
networks:
2946
- jobs # only accessible by the jobs service
47+
volumes:
48+
- ./services/jobs/cassandra-config/cassandra.yaml:/etc/cassandra/cassandra.yaml
3049
healthcheck:
3150
test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
32-
interval: 5s
33-
timeout: 5s
51+
interval: 20s
52+
timeout: 10s
3453
retries: 60
3554
ports:
3655
- "9042:9042"
3756

57+
payments_db:
58+
image: postgres:latest
59+
environment:
60+
POSTGRES_PASSWORD: payments_password
61+
POSTGRES_USER: payments_user
62+
POSTGRES_DB: payments_database
63+
ports:
64+
- "5432:5432"
65+
3866
networks:
3967
microservices:
4068
driver: bridge
4169
jobs:
70+
driver: bridge
71+
payments:
4272
driver: bridge

pom.xml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>com.workup</groupId>
88
<artifactId>main</artifactId>
99
<version>1.0-SNAPSHOT</version>
10-
<packaging>pom</packaging>
10+
<packaging>pom</packaging>
1111

12-
1312
<properties>
1413
<maven.compiler.source>21</maven.compiler.source>
1514
<maven.compiler.target>21</maven.compiler.target>
@@ -20,6 +19,42 @@
2019
<module>services/jobs</module>
2120
<module>services/payments</module>
2221
<module>services/users</module>
22+
<module>services/contracts</module>
2323
</modules>
2424

25+
<build>
26+
<plugins>
27+
<plugin>
28+
<groupId>com.cosium.code</groupId>
29+
<artifactId>git-code-format-maven-plugin</artifactId>
30+
<version>5.3</version>
31+
<executions>
32+
<!-- On commit, format the modified files -->
33+
<execution>
34+
<id>install-formatter-hook</id>
35+
<goals>
36+
<goal>install-hooks</goal>
37+
</goals>
38+
</execution>
39+
<!-- On Maven verify phase, fail if any file
40+
(including unmodified) is badly formatted -->
41+
<execution>
42+
<id>validate-code-format</id>
43+
<goals>
44+
<goal>validate-code-format</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
<dependencies>
49+
<!-- Enable https://github.com/google/google-java-format -->
50+
<dependency>
51+
<groupId>com.cosium.code</groupId>
52+
<artifactId>google-java-format</artifactId>
53+
<version>5.3</version>
54+
</dependency>
55+
</dependencies>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
2560
</project>

services/contracts/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
HELP.md
2+
target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**/target/
5+
!**/src/test/**/target/
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
!**/src/main/**/build/
30+
!**/src/test/**/build/
31+
32+
### VS Code ###
33+
.vscode/
34+
35+
data
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

services/contracts/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM eclipse-temurin:21-jre-alpine
2+
VOLUME /tmp
3+
ARG JAR_FILE=target/*.jar
4+
COPY ${JAR_FILE} contracts.jar
5+
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /contracts.jar ${0} ${@}"]

services/contracts/docker-compose.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: "3.9"
2+
3+
services:
4+
db:
5+
image: "cassandra:latest"
6+
ports:
7+
- "9042:9042"
8+
volumes:
9+
- ./data:/var/lib/cassandra
10+
# - ./etc/cassandra:/etc/cassandra
11+
healthcheck:
12+
test: [ "CMD", "cqlsh", "-e", "describe keyspaces" ]
13+
interval: 5s
14+
timeout: 5s
15+
retries: 60
16+
environment:
17+
CASSANDRA_USE_ASTRA: "false"
18+
CASSANDRA_USER: "cassandra"
19+
CASSANDRA_PASSWORD: "cassandra"
20+
CASSANDRA_LOCAL_DC: "datacenter1"
21+
CASSANDRA_CONTACT_POINTS: "db:9042"
22+
CASSANDRA_KEYSPACE_CQL: "CREATE KEYSPACE test_keyspace WITH REPLICATION = {'class':'SimpleStrategy','replication_factor':1};"
23+
MONITORING_PROMETHEUS: "false"
24+
MONITORING_GRAFANA: "false"
25+
DISTRIBUTED_TRACING_ENABLED: "false"
26+
27+
## RUN ON HOST FOR NOW ##########
28+
# contracts:
29+
# depends_on:
30+
# - db
31+
# - rabbitmq
32+
# build:
33+
# context: .
34+
# dockerfile: ./Dockerfile
35+
# container_name: "workup_contracts_spring"
36+
# volumes:
37+
# - .:/app:z
38+
# ports:
39+
# - "8000:8080"
40+
41+
rabbitmq:
42+
image: rabbitmq:3-management-alpine
43+
container_name: 'rabbitmq'
44+
ports:
45+
- "5672:5672"
46+
- "15672:15672"
47+
volumes:
48+
- ./data/:/var/lib/rabbitmq/
49+
- ./data:/var/log/rabbitmq

0 commit comments

Comments
 (0)