Skip to content

Commit

Permalink
Setup boilerplate order service
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell-balla committed Nov 24, 2024
1 parent eb63fa8 commit d3bd48a
Show file tree
Hide file tree
Showing 24 changed files with 983 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/order-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Order Service

on:
push:
paths:
- order-service/**
branches:
- '**'
pull_request:
branches: [master]

jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
working-directory: ./order-service
defaults:
run:
working-directory: ${{ env.working-directory }}
steps:
- uses: actions/checkout@v4

- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Make Maven wrapper executable
run: chmod +x mvnw

- name: Force update Maven dependencies and build
run: ./mvnw clean install -U

- name: Run tests
run: ./mvnw test
2 changes: 2 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions deployment/docker-compose/infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,44 @@ services:
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 500m

orders-db:
image: postgres:16-alpine
container_name: orders-db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- "25432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 500m

bookstore-rabbitmq:
image: rabbitmq:3.12.11-management
container_name: bookstore-rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=rabbitmq
- RABBITMQ_DEFAULT_PASS=rabbitmq
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 30s
timeout: 30s
retries: 10
deploy:
resources:
limits:
Expand Down
2 changes: 2 additions & 0 deletions order-service/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
33 changes: 33 additions & 0 deletions order-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
19 changes: 19 additions & 0 deletions order-service/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
Loading

0 comments on commit d3bd48a

Please sign in to comment.