-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
331 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CI/CD pipeline for product catalog service | ||
name: catalog-service | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: eshop | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: oracle | ||
java-version: 21 | ||
- name: Setup Task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
version: 3.x | ||
repo-token: ${{ secrets.GH_TOKEN }} | ||
- name: Test all services | ||
run: task test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: api-gateway | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: oracle | ||
java-version: 21 | ||
- name: Setup Task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
version: 3.x | ||
repo-token: ${{ secrets.GH_TOKEN }} | ||
- name: Test api gateway | ||
run: task gateway:test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,8 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Gradle ### | ||
.gradle/ | ||
.idea/ | ||
**/.gradle/ | ||
**/gradle/ | ||
**/build/ | ||
**/gradlew* | ||
|
||
!/gradle/ | ||
!/gradlew* |
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
version: 3 | ||
|
||
includes: | ||
catalog: | ||
taskfile: ./catalog-service/Taskfile.yaml | ||
gateway: | ||
taskfile: ./api-gateway/Taskfile.yaml | ||
|
||
tasks: | ||
catalog:clean: | ||
desc: Clean product catalog service build | ||
cmd: ./gradlew catalog:clean | ||
clean: | ||
desc: Clean all projects | ||
cmd: ./gradlew clean --parallel | ||
silent: true | ||
|
||
catalog:run: | ||
desc: Run product catalog service | ||
cmd: ./gradlew catalog:bootRun | ||
run: | ||
desc: Run all projects | ||
cmd: ./gradlew bootRun --parallel | ||
silent: true | ||
test: | ||
desc: Test all projects | ||
cmd: ./gradlew test --parallel | ||
silent: true | ||
|
||
catalog:test: | ||
desc: Test product catalog service | ||
cmds: | ||
- task: catalog:clean | ||
- ./gradlew catalog:test | ||
gradle:stop: | ||
desc: Stop all gradle daemons | ||
cmd: ./gradlew --stop | ||
silent: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Getting Started | ||
|
||
### Reference Documentation | ||
For further reference, please consider the following sections: | ||
|
||
* [Official Gradle documentation](https://docs.gradle.org) | ||
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.3/gradle-plugin) | ||
* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.3/gradle-plugin/packaging-oci-image.html) | ||
* [Reactive Gateway](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/) | ||
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#using.devtools) | ||
|
||
### Guides | ||
The following guides illustrate how to use some features concretely: | ||
|
||
* [Using Spring Cloud Gateway](https://github.com/spring-cloud-samples/spring-cloud-gateway-sample) | ||
|
||
### Additional Links | ||
These additional references should also help you: | ||
|
||
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: 3 | ||
|
||
tasks: | ||
clean: | ||
desc: Clean api gateway build | ||
cmd: ./gradlew :api-gateway:clean | ||
silent: true | ||
|
||
run: | ||
desc: Run api gateway | ||
cmd: ./gradlew :api-gateway:bootRun | ||
silent: true | ||
|
||
test: | ||
desc: Test api gateway | ||
cmds: | ||
- task: clean | ||
- ./gradlew :api-gateway:test | ||
silent: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.3' | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
} | ||
|
||
group = 'io.dksifoua.eshop' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('springCloudVersion', "2023.0.3") | ||
} | ||
|
||
dependencies { | ||
if (System.getProperty("os.name").toLowerCase().contains("mac")) { | ||
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.113.Final:osx-aarch_64' | ||
} | ||
|
||
implementation 'org.springframework.cloud:spring-cloud-starter-gateway' | ||
developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'io.projectreactor:reactor-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" | ||
} | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'gateway' |
13 changes: 13 additions & 0 deletions
13
api-gateway/src/main/java/io/dksifoua/eshop/gateway/ApiGatewayApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.dksifoua.eshop.gateway; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class ApiGatewayApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ApiGatewayApplication.class, args); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
server: | ||
port: 8080 | ||
|
||
spring: | ||
application: | ||
name: api-gateway | ||
devtools: | ||
livereload: | ||
port: 35730 | ||
|
||
cloud: | ||
gateway: | ||
routes: | ||
- id: catalog-service | ||
uri: http://localhost:8081 | ||
predicates: | ||
- Path=/api/v1/catalog/** | ||
logging: | ||
level: | ||
root: info | ||
org.springframework.cloud.gateway: trace | ||
org.springframework.web: debug | ||
org.springframework.web.reactive: debug |
13 changes: 13 additions & 0 deletions
13
api-gateway/src/test/java/io/dksifoua/eshop/gateway/ApiGatewayApplicationTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.dksifoua.eshop.gateway; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class ApiGatewayApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Getting Started | ||
|
||
### Reference Documentation | ||
For further reference, please consider the following sections: | ||
|
||
* [Official Gradle documentation](https://docs.gradle.org) | ||
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.3/gradle-plugin) | ||
* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.3/gradle-plugin/packaging-oci-image.html) | ||
* [Spring Boot Testcontainers support](https://docs.spring.io/spring-boot/3.3.3/reference/testing/testcontainers.html#testing.testcontainers) | ||
* [Testcontainers MongoDB Module Reference Guide](https://java.testcontainers.org/modules/databases/mongodb/) | ||
* [Spring Data MongoDB](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#data.nosql.mongodb) | ||
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#using.devtools) | ||
* [Docker Compose Support](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#features.docker-compose) | ||
* [Testcontainers](https://java.testcontainers.org/) | ||
* [Spring Reactive Web](https://docs.spring.io/spring-boot/docs/3.3.3/reference/htmlsingle/index.html#web.reactive) | ||
|
||
### Guides | ||
The following guides illustrate how to use some features concretely: | ||
|
||
* [Accessing Data with MongoDB](https://spring.io/guides/gs/accessing-data-mongodb/) | ||
* [Building a Reactive RESTful Web Service](https://spring.io/guides/gs/reactive-rest-service/) | ||
|
||
### Additional Links | ||
These additional references should also help you: | ||
|
||
* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle) | ||
|
||
### Docker Compose support | ||
This project contains a Docker Compose file named `compose.yaml`. | ||
In this file, the following services have been defined: | ||
|
||
* mongodb: [`mongo:latest`](https://hub.docker.com/_/mongo) | ||
|
||
Please review the tags of the used images and set them to the same as you're running in production. | ||
|
||
### Testcontainers support | ||
|
||
This project uses [Testcontainers at development time](https://docs.spring.io/spring-boot/3.3.3/reference/features/dev-services.html#features.dev-services.testcontainers). | ||
|
||
Testcontainers has been configured to use the following Docker images: | ||
|
||
* [`mongo:latest`](https://hub.docker.com/_/mongo) | ||
|
||
Please review the tags of the used images and set them to the same as you're running in production. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: 3 | ||
|
||
tasks: | ||
clean: | ||
desc: Clean product catalog service build | ||
cmd: ./gradlew :catalog-service:clean | ||
silent: true | ||
|
||
run: | ||
desc: Run product catalog service | ||
cmd: ./gradlew :catalog-service:bootRun | ||
silent: true | ||
|
||
test: | ||
desc: Test product catalog service | ||
cmds: | ||
- task: clean | ||
- ./gradlew :catalog-service:test | ||
silent: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.