Skip to content

Commit

Permalink
Merge branch 'dev' into RSWW-49-Dodać-10-przykładowych-userów
Browse files Browse the repository at this point in the history
  • Loading branch information
Danzigerrr authored May 10, 2024
2 parents 02bebc3 + 91626f1 commit b6331c2
Show file tree
Hide file tree
Showing 31 changed files with 703 additions and 98 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/test-hotel-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Travel API CI - Hotel service

on:
push:
branches: [ "dev" ]
paths:
- 'hotel-service/**'
pull_request:
branches: [ "dev" ]
paths:
- 'hotel-service/**'

permissions: write-all

jobs:
test:
name: Package and execute tests
runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
cache: maven
- name: Build transport-service
run: mvn -B package --file hotel-service/pom.xml

- name: transport-service test reports
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
hotel-service/target/surefire-reports/TEST-*.xml
38 changes: 38 additions & 0 deletions .github/workflows/test-transport-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Travel API CI - Transport service

on:
push:
branches: [ "dev" ]
paths:
- 'transport-service/**'
pull_request:
branches: [ "dev" ]
paths:
- 'transport-service/**'

permissions: write-all

jobs:
test:
name: Package and execute tests
runs-on: ubuntu-latest
if: always()

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
cache: maven
- name: Build transport-service
run: mvn -B package --file transport-service/pom.xml

- name: transport-service test reports
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
transport-service/target/surefire-reports/TEST-*.xml
7 changes: 0 additions & 7 deletions api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
7 changes: 0 additions & 7 deletions discovery-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
31 changes: 31 additions & 0 deletions docker-compose-database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3.9'
name: mcarchvsc

services:
db:
image: postgres
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: database
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- "5432:5432"
restart: unless-stopped
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 20

volumes:
postgres:

networks:
backend:
name: mcarchvsc_backend
external: true
26 changes: 13 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: "3.9"
name: mcarchvsc
version: "3"

services:
rabbitmq:
image: rabbitmq:3.13-management
hostname: rabbitmq
ports:
- 5672:5672
- 15672:15672
- "5672:5672"
- "15672:15672"
networks:
- backend

discovery:
hostname: discovery
build: ./discovery-service
ports:
- 8010:8010
- "8010:8010"
depends_on:
- rabbitmq
networks:
Expand All @@ -24,7 +24,7 @@ services:
gateway:
build: ./api-gateway
ports:
- 8082:8082
- "8082:8082"
depends_on:
- rabbitmq
- discovery
Expand Down Expand Up @@ -79,14 +79,14 @@ services:
- backend

user:
build: ./user-service
depends_on:
- rabbitmq
- discovery
- gateway
- userdb
networks:
- backend
build: ./user-service
depends_on:
- rabbitmq
- discovery
- gateway
- userdb
networks:
- backend

userdb:
image: postgres
Expand Down
7 changes: 0 additions & 7 deletions hotel-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
7 changes: 0 additions & 7 deletions offer-provider-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
7 changes: 0 additions & 7 deletions payment-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
7 changes: 0 additions & 7 deletions reservation-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
7 changes: 0 additions & 7 deletions transport-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# syntax=docker/dockerfile:1

FROM jelastic/maven:3.9.5-openjdk-21 AS build

ENV HOME=/usr/app
RUN mkdir -p $HOME
WORKDIR $HOME
ADD . $HOME

RUN --mount=type=cache,target=/root/.m2 mvn clean package -Dmaven.test.skip


FROM openjdk:21

ARG JAR_FILE=/usr/app/target/*.jar
COPY --from=build $JAR_FILE /app/runner.jar

ENTRYPOINT java -jar /app/runner.jar
9 changes: 9 additions & 0 deletions transport-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
<artifactId>hibernate-validator</artifactId>
<version>8.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
public class TransportApplication {

public static void main(String[] args) {
Expand Down
Loading

0 comments on commit b6331c2

Please sign in to comment.