Skip to content

Commit 60ecfe2

Browse files
committed
Order Service Skeleton Setup
1 parent 4d951c5 commit 60ecfe2

File tree

20 files changed

+1042
-6
lines changed

20 files changed

+1042
-6
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Order Service
2+
3+
on:
4+
push:
5+
paths:
6+
- order-service/**
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
env:
15+
working-directory: ./order-service
16+
DOCKER_IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/bookstore-order-service
17+
defaults:
18+
run:
19+
working-directory: ${{ env.working-directory }}
20+
steps:
21+
- uses: actions/checkout@v5
22+
23+
- name: Setup Java 21
24+
uses: actions/setup-java@v5
25+
with:
26+
java-version: '21'
27+
distribution: 'temurin'
28+
cache: 'maven'
29+
30+
- name: Make Maven wrapper executable
31+
run: chmod +x mvnw
32+
33+
- name: Build with Maven
34+
run: ./mvnw -ntp verify
35+
36+
- name: Login to Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
42+
- name: Build and Publish Docker Image
43+
run: |
44+
./mvnw spring-boot:build-image -DskipTests
45+
echo "Pushing the image $DOCKER_IMAGE_NAME to Docker Hub..."
46+
docker push $DOCKER_IMAGE_NAME

.idea/encodings.xml

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

catalog-service/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@
135135
<version>4.0.24</version>
136136
<scope>test</scope>
137137
</dependency>
138-
<dependency>
139-
<groupId>org.apache.groovy</groupId>
140-
<artifactId>groovy-xml</artifactId>
141-
<version>4.0.24</version>
142-
<scope>test</scope>
143-
</dependency>
144138
<dependency>
145139
<groupId>org.springframework.boot</groupId>
146140
<artifactId>spring-boot-starter-test</artifactId>

deployment/docker-compose/infra.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,44 @@ services:
1515
interval: 10s
1616
timeout: 5s
1717
retries: 5
18+
deploy:
19+
resources:
20+
limits:
21+
memory: 500m
22+
23+
orders-db:
24+
image: postgres:18-alpine
25+
container_name: orders-db
26+
environment:
27+
- POSTGRES_USER=postgres
28+
- POSTGRES_PASSWORD=postgres
29+
- POSTGRES_DB=postgres
30+
ports:
31+
- "25432:5432"
32+
healthcheck:
33+
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
34+
interval: 10s
35+
timeout: 5s
36+
retries: 5
37+
deploy:
38+
resources:
39+
limits:
40+
memory: 500m
41+
42+
bookstore-rabbitmq:
43+
image: rabbitmq:4.0.4-management
44+
container_name: bookstore-rabbitmq
45+
environment:
46+
- RABBITMQ_DEFAULT_USER=guest
47+
- RABBITMQ_DEFAULT_PASS=guest
48+
ports:
49+
- "5672:5672"
50+
- "15672:15672"
51+
healthcheck:
52+
test: rabbitmq-diagnostics check_port_connectivity
53+
interval: 30s
54+
timeout: 30s
55+
retries: 10
1856
deploy:
1957
resources:
2058
limits:

order-service/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/mvnw text eol=lf
2+
*.cmd text eol=crlf

order-service/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip

0 commit comments

Comments
 (0)