Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
70ea6e8
Merge pull request #127 from SelimHorri/develop
SelimHorri Dec 29, 2021
9811117
Merge pull request #128 from SelimHorri/stage
SelimHorri Dec 29, 2021
a64d746
Merge pull request #129 from SelimHorri/develop
SelimHorri Dec 29, 2021
db90995
Merge pull request #130 from SelimHorri/stage
SelimHorri Dec 29, 2021
22ae224
Merge pull request #131 from SelimHorri/develop
SelimHorri Dec 30, 2021
c3b532b
Merge pull request #132 from SelimHorri/stage
SelimHorri Dec 30, 2021
8216baf
Merge pull request #133 from SelimHorri/develop
SelimHorri Dec 31, 2021
96d28c2
Merge pull request #134 from SelimHorri/stage
SelimHorri Dec 31, 2021
420b1b0
Merge pull request #135 from SelimHorri/develop
SelimHorri Jan 1, 2022
6f6c9cf
Merge pull request #136 from SelimHorri/stage
SelimHorri Jan 1, 2022
c9083fb
Merge pull request #137 from SelimHorri/develop
SelimHorri Jan 2, 2022
8712e8f
Merge pull request #138 from SelimHorri/stage
SelimHorri Jan 2, 2022
3b367bf
Merge pull request #139 from SelimHorri/develop
SelimHorri Jan 2, 2022
765cee4
Merge pull request #140 from SelimHorri/stage
SelimHorri Jan 2, 2022
982a696
Merge pull request #141 from SelimHorri/develop
SelimHorri Jan 2, 2022
06e7f68
Merge pull request #142 from SelimHorri/stage
SelimHorri Jan 2, 2022
ce4515f
Merge pull request #143 from SelimHorri/develop
SelimHorri Jan 3, 2022
695a6d4
Merge pull request #144 from SelimHorri/stage
SelimHorri Jan 3, 2022
bee810c
Feat: Project Run
JuanseDev2001 Oct 23, 2025
5d1b3a7
creating branches
JuanseDev2001 Oct 24, 2025
81c7252
feat: Added some basic unit and integration tests to each microservice
JuanseDev2001 Oct 25, 2025
a72f956
feat: e2e and global integration tests
JuanseDev2001 Oct 25, 2025
956c852
fix: some test changes still needs work
JuanseDev2001 Oct 25, 2025
abae220
fix: reverting dockerfiles and compose.ymls with slight changes
JuanseDev2001 Oct 25, 2025
946c8b7
Merge branch 'dev' into stage
JuanseDev2001 Oct 25, 2025
1a3a4d5
feat: reverted all dockerfiles to legacy direct jar access build work
JuanseDev2001 Oct 25, 2025
ead82c9
feat: fixed eureka config, added e2e and deployment/container health …
JuanseDev2001 Oct 25, 2025
b809650
feat: Added order, payment, shipping an user e2e tests
JuanseDev2001 Oct 25, 2025
d79e764
fixing global test pathing
JuanseDev2001 Oct 26, 2025
59ac1d1
fix: fixed shipping e2e test
JuanseDev2001 Oct 26, 2025
ccd95af
jenkins config
JuanseDev2001 Oct 26, 2025
b3a8872
testing jenkins
JuanseDev2001 Oct 26, 2025
37f08a7
Merge pull request #1 from JuanseDev2001/test_jenkins
JuanseDev2001 Oct 26, 2025
6bd5e26
test j
JuanseDev2001 Oct 26, 2025
a57b7e4
Merge branch 'test_jenkins' into dev
JuanseDev2001 Oct 26, 2025
372f253
Update README.md
JuanseDev2001 Oct 26, 2025
9cb7200
Merge branch 'test_jenkins' into dev
JuanseDev2001 Oct 26, 2025
25de8b9
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
5394d6d
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
9765609
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
8500210
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
5618518
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
d917eb4
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
62f8dd5
Update Jenkinsfile
JuanseDev2001 Oct 26, 2025
64931cc
Merge branch 'stage' into dev
JuanseDev2001 Oct 26, 2025
039143c
Update Jenkinsfile
JuanseDev2001 Oct 27, 2025
30cc933
Update Jenkinsfile
JuanseDev2001 Oct 27, 2025
94cc186
feat: reseting jenkins
JuanseDev2001 Oct 29, 2025
de33205
feat: config refactor
JuanseDev2001 Oct 29, 2025
14d7d52
feat: jenkins files test
JuanseDev2001 Oct 30, 2025
e2de2f7
feat: java further testing
JuanseDev2001 Oct 30, 2025
3a56544
fix: made docker default java 17, fixed basic jenkins files.
JuanseDev2001 Oct 30, 2025
ab44087
feat: made jenkins run docker image in kubernets
JuanseDev2001 Oct 30, 2025
e3d77dd
feat: dev pipeline works, added jenkins.md and added jenkins minikube…
JuanseDev2001 Oct 31, 2025
b40cf22
fix:jenkins setup fix
JuanseDev2001 Oct 31, 2025
7445ae8
fix: docker log in credencials in jenkins pipelines for microservices
JuanseDev2001 Oct 31, 2025
9e2b8e5
fix: missing docker config
JuanseDev2001 Oct 31, 2025
6f9e9b6
fix: unnecesary
JuanseDev2001 Oct 31, 2025
53c63c1
feat: commented tests that are not gonna be in use, added missing mic…
JuanseDev2001 Oct 31, 2025
d504bb9
fix: quick fix
JuanseDev2001 Oct 31, 2025
cab020e
Merge pull request #17 from JuanseDev2001/dev
JuanseDev2001 Oct 31, 2025
620af66
feat: jenkins pipeline stage setup
JuanseDev2001 Oct 31, 2025
dacf20e
Update README.md
JuanseDev2001 Oct 31, 2025
82586b3
feat: yaml for minikube in pipeline
JuanseDev2001 Oct 31, 2025
5dc2f62
Update Jenkinsfile.stage
JuanseDev2001 Oct 31, 2025
770a956
feat: stage jenkins test
JuanseDev2001 Oct 31, 2025
fe93799
Update Jenkinsfile.stage
JuanseDev2001 Oct 31, 2025
1b101b0
Merge branch 'stage' into dev
JuanseDev2001 Oct 31, 2025
7c3b258
Update Jenkinsfile.stage
JuanseDev2001 Oct 31, 2025
9ac7f3f
Merge branch 'stage' into dev
JuanseDev2001 Oct 31, 2025
ed1160c
.
JuanseDev2001 Oct 31, 2025
f6b59ed
feat: updates
JuanseDev2001 Oct 31, 2025
3c6fbc4
feat: jenkins fix
JuanseDev2001 Oct 31, 2025
e53eee7
Update OrderServiceE2ETest.java
JuanseDev2001 Oct 31, 2025
113e6ad
Update UserServiceE2ETest.java
JuanseDev2001 Oct 31, 2025
beec1af
Update Jenkinsfile.stage
JuanseDev2001 Oct 31, 2025
42e0178
feat: finishing up stage pipeline
JuanseDev2001 Oct 31, 2025
b1c76ce
feat: adding missing K8 yamls
JuanseDev2001 Oct 31, 2025
8d80517
fix: fixed ports
JuanseDev2001 Oct 31, 2025
a0c1e6f
feat: fixed eureka connection and added service-discovery to pipeline…
JuanseDev2001 Oct 31, 2025
e3e3a80
Update Jenkinsfile.stage
JuanseDev2001 Oct 31, 2025
7d4dd0d
fix: pod eureka fix test
JuanseDev2001 Oct 31, 2025
cd5a3cb
fix
JuanseDev2001 Oct 31, 2025
cae87a0
fix
JuanseDev2001 Oct 31, 2025
4583dc0
fix: added non secure port for communication and other references in …
JuanseDev2001 Oct 31, 2025
7a421b1
Update Jenkinsfile.stage
JuanseDev2001 Nov 1, 2025
1ff9f9c
Update order-service.yaml
JuanseDev2001 Nov 1, 2025
8befd79
fix
JuanseDev2001 Nov 1, 2025
b836b2e
Update OrderServiceE2ETest.java
JuanseDev2001 Nov 1, 2025
2e80664
fix: revert to check something
JuanseDev2001 Nov 1, 2025
8bc8c2a
Update Jenkinsfile.stage
JuanseDev2001 Nov 1, 2025
f10dc54
fix
JuanseDev2001 Nov 1, 2025
cfdc223
fix
JuanseDev2001 Nov 1, 2025
cd15af7
Update Jenkinsfile.stage
JuanseDev2001 Nov 1, 2025
58aa21d
fix
JuanseDev2001 Nov 1, 2025
f9b8489
Update application.yml
JuanseDev2001 Nov 1, 2025
0eae5ae
fix
JuanseDev2001 Nov 1, 2025
034c8ec
fix
JuanseDev2001 Nov 1, 2025
0ba547c
fix: added zipkin
JuanseDev2001 Nov 1, 2025
3c3f5a1
fix: actuatore health path
JuanseDev2001 Nov 1, 2025
44a80d4
fix: service-discovery
JuanseDev2001 Nov 1, 2025
08134a3
fix
JuanseDev2001 Nov 1, 2025
6abceb1
feat: final pipeline
JuanseDev2001 Nov 1, 2025
58b8841
Merge branch 'stage' into dev
JuanseDev2001 Nov 1, 2025
d790918
fix.
JuanseDev2001 Nov 1, 2025
484a08f
fix
JuanseDev2001 Nov 1, 2025
bcfccfd
Update Jenkins.md
JuanseDev2001 Nov 1, 2025
b8dd54d
Update Jenkinsfile.prod
JuanseDev2001 Nov 1, 2025
d6f4154
Merge branch 'stage' into dev
JuanseDev2001 Nov 1, 2025
b9ba088
feat: Performance Tests added and edited Jenkins to install python wi…
JuanseDev2001 Nov 3, 2025
1752ca3
Merge branch 'stage' into dev
JuanseDev2001 Nov 3, 2025
ac324dd
fix: removed -n stage namespace as it is interfering with tests, left…
JuanseDev2001 Nov 3, 2025
7575ebd
Merge branch 'stage' into dev
JuanseDev2001 Nov 3, 2025
95bc007
Update Jenkinsfile.stage
JuanseDev2001 Nov 4, 2025
41fa70f
feat: fixed performance test in pipeline
JuanseDev2001 Nov 4, 2025
60d8aa3
Update validate_performance.py
JuanseDev2001 Nov 4, 2025
bfdd4bf
Update validate_performance.py
JuanseDev2001 Nov 4, 2025
17e6248
Update validate_performance.py
JuanseDev2001 Nov 4, 2025
c96002c
feat: added
JuanseDev2001 Nov 4, 2025
ae420c6
feat: added release notes to master pipeline
JuanseDev2001 Nov 4, 2025
1e671b6
Merge branch 'stage' into dev
JuanseDev2001 Nov 4, 2025
7c4ff23
added simple pometheus and logstatsh conf
JhonatanCI Nov 25, 2025
300c315
actuator and dependencies
JhonatanCI Nov 27, 2025
3170dcb
logback config
JhonatanCI Nov 27, 2025
9454460
Add custom health indicators
JhonatanCI Nov 27, 2025
ea306f8
Add business metrics services
JhonatanCI Nov 27, 2025
2a22abb
Add resilience patterns
JhonatanCI Nov 27, 2025
df9e491
Add feature toggle pattern
JhonatanCI Nov 27, 2025
9c21721
Configure Prometheus and alerting
JhonatanCI Nov 27, 2025
9497db3
Add observability docker stack
JhonatanCI Nov 27, 2025
5555bb7
empty push
JuanseDev2001 Nov 28, 2025
aa38d7f
feat: added sonarqube
JuanseDev2001 Nov 29, 2025
16b3a08
Merge pull request #21 from JuanseDev2001/4-CI/CD_avanzado
JuanseDev2001 Nov 29, 2025
6ca6b57
feat: edited pipelines
JuanseDev2001 Nov 29, 2025
c5a604b
feat: sonar pipeline done, quality takes too long
JuanseDev2001 Nov 29, 2025
0f51734
feat: actualize los dockerfiles y añadi sonar y trivy falta probar trivy
JuanseDev2001 Nov 30, 2025
9969c7a
Merge pull request #23 from JuanseDev2001/4-CI/CD_avanzado
JuanseDev2001 Nov 30, 2025
05b3334
empty push
JuanseDev2001 Nov 30, 2025
8cc1d29
Merge pull request #24 from JuanseDev2001/4-CI/CD_avanzado
JuanseDev2001 Nov 30, 2025
f63559c
Merge branch 'dev' into 3-Patrones-de-Diseño
JuanseDev2001 Nov 30, 2025
371b5c7
merge: integrate dev changes
JhonatanCI Nov 30, 2025
b4d247d
fix versions and put documantation
JhonatanCI Nov 30, 2025
7f769bc
Merge branch '3-Patrones-de-Diseño' of https://github.com/JuanseDev20…
JhonatanCI Nov 30, 2025
ebf043d
chore: update all Dockerfiles to use openjdk:11 base image
JhonatanCI Nov 30, 2025
e445afb
return compose.yml
JhonatanCI Nov 30, 2025
e279f90
Update compose.yml
JhonatanCI Nov 30, 2025
fc46948
clean docs
JhonatanCI Nov 30, 2025
fa2ba21
scripts for deploy
JhonatanCI Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ target/
!**/src/main/**/target/
!**/src/test/**/target/

# Environment variables and secrets
.env
*.tfvars
!*.tfvars.example

# Terraform files
**/.terraform/
**/.terraform.lock.hcl
**/terraform.tfstate
**/terraform.tfstate.backup
**/*.tfplan

# Keys and credentials
infra/keys/
*.json
!package.json
!package-lock.json
!tsconfig.json

### STS ###
.apt_generated
.classpath
Expand Down Expand Up @@ -31,3 +50,6 @@ build/

### VS Code ###
.vscode/

## Keys ##
infra/keys/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!--## Better Code Hub
I analysed this repository according to the clean code standards on [Better Code Hub](https://bettercodehub.com/) just to get an independent opinion of how bad the code is. Surprisingly, the compliance score is high!
-->
## Introduction
## Introduction
- This project is a development of a small set of **Spring Boot** and **Cloud** based Microservices projects that implement cloud-native intuitive, Reactive Programming, Event-driven, Microservices design patterns, and coding best practices.
- The project follows **CloudNative**<!--(https://www.cncf.io/)--> recommendations and The [**twelve-factor app**](https://12factor.net/) methodology for building *software-as-a-service apps* to show how μServices should be developed and deployed.
- This project uses cutting edge technologies like Docker, Kubernetes, Elasticsearch Stack for
Expand Down
7 changes: 2 additions & 5 deletions api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@

FROM openjdk:11
ARG PROJECT_VERSION=0.1.0
RUN mkdir -p /home/app
WORKDIR /home/app
ENV SPRING_PROFILES_ACTIVE dev
ENV SPRING_PROFILES_ACTIVE=dev
COPY api-gateway/ .
ADD api-gateway/target/api-gateway-v${PROJECT_VERSION}.jar api-gateway.jar
EXPOSE 8080
ENTRYPOINT ["java", "-Dspring.profiles.active=${SPRING_PROFILES_ACTIVE}", "-jar", "api-gateway.jar"]


ENTRYPOINT ["java", "-Dspring.profiles.active=${SPRING_PROFILES_ACTIVE}", "-jar", "api-gateway.jar"]
17 changes: 13 additions & 4 deletions api-gateway/compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@

version: '3'
services:
api-gateway-container:
image: selimhorri/api-gateway-ecommerce-boot:0.1.0
image: juanse201/api-gateway-ecommerce-boot:0.1.0
ports:
- 8080:8080
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_ZIPKIN_BASE_URL=http://zipkin:9411
- SPRING_CONFIG_IMPORT=optional:configserver:http://cloud-config-container:9296/
- EUREKA_CLIENT_REGION=default
- EUREKA_CLIENT_AVAILABILITY_ZONES_DEFAULT=myzone
- EUREKA_CLIENT_SERVICEURL_MYZONE=http://service-discovery-container:8761/eureka
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://service-discovery-container:8761/eureka/
networks:
- microservices_network



networks:
microservices_network:
external: true
name: microservices_network
7 changes: 7 additions & 0 deletions api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.5.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
10 changes: 8 additions & 2 deletions api-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ server:

spring:
zipkin:
base-url: ${SPRING_ZIPKIN_BASE_URL:http://localhost:9411/}
base-url: ${SPRING_ZIPKIN_BASE_URL:http://zipkin:9411/}
config:
import: ${SPRING_CONFIG_IMPORT:optional:configserver:http://localhost:9296}
import: ${SPRING_CONFIG_IMPORT:optional:configserver:http://cloud-config-container:9296}
application:
name: API-GATEWAY
profiles:
Expand Down Expand Up @@ -62,6 +62,12 @@ spring:
predicates:
- Path=/app/**

eureka:
client:
service-url:
defaultZone: ${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE:http://service-discovery-container:8761/eureka/}


resilience4j:
circuitbreaker:
instances:
Expand Down
49 changes: 49 additions & 0 deletions build-and-push.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# PowerShell script to build and push all microservice images to Docker Hub

$ErrorActionPreference = 'Continue'

# Remove all local Docker images (force, only if any exist)
$localImages = docker images -q
if ($localImages) {
Write-Host "Removing all local Docker images..." -ForegroundColor Yellow
docker rmi -f $localImages
} else {
Write-Host "No local Docker images to remove." -ForegroundColor Green
}

# Array of service names
$services = @(
"cloud-config",
"service-discovery",
"api-gateway",
"proxy-client",
"order-service",
"payment-service",
"product-service",
"shipping-service",
"user-service",
"favourite-service"
)

# Docker Hub username
$dockerUser = "juanse201"


foreach ($service in $services) {
$imageName = "$dockerUser/$service-ecommerce-boot:0.1.0"
$dockerfilePath = "./$service/Dockerfile"
Write-Host "Building $imageName ..."
docker build -t $imageName -f $dockerfilePath .
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed for $service" -ForegroundColor Red
exit 1
}
Write-Host "Pushing $imageName ..."
docker push $imageName
if ($LASTEXITCODE -ne 0) {
Write-Host "Push failed for $service" -ForegroundColor Red
exit 1
}
}

Write-Host "All images built and pushed successfully!" -ForegroundColor Green
5 changes: 1 addition & 4 deletions cloud-config/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@

FROM openjdk:11
ARG PROJECT_VERSION=0.1.0
RUN mkdir -p /home/app
WORKDIR /home/app
COPY cloud-config/ .
ADD cloud-config/target/cloud-config-v${PROJECT_VERSION}.jar cloud-config.jar
EXPOSE 9296
ENTRYPOINT ["java", "-jar", "cloud-config.jar"]


ENTRYPOINT ["java", "-jar", "cloud-config.jar"]
4 changes: 1 addition & 3 deletions cloud-config/compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

version: '3'
services:
cloud-config-container:
image: selimhorri/cloud-config-ecommerce-boot:0.1.0
image: juanse201/cloud-config-ecommerce-boot:0.1.0
ports:
- 9296:9296
environment:
- SPRING_PROFILES_ACTIVE=dev



7 changes: 6 additions & 1 deletion cloud-config/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ server:

spring:
zipkin:
base-url: ${SPRING_ZIPKIN_BASE_URL:http://localhost:9411/}
base-url: ${SPRING_ZIPKIN_BASE_URL:http://zipkin:9411/}
application:
name: CLOUD-CONFIG
cloud:
Expand All @@ -14,6 +14,11 @@ spring:
uri: https://github.com/SelimHorri/cloud-config-server
clone-on-start: true

eureka:
client:
service-url:
defaultZone: ${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE:http://service-discovery-container:8761/eureka/}

resilience4j:
circuitbreaker:
instances:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.selimhorri.app.integration;

import com.selimhorri.app.CloudConfigApplication;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import static org.junit.jupiter.api.Assertions.*;

@SpringBootTest(classes = CloudConfigApplication.class)
class CloudConfigApplicationIntegrationTests {

@Autowired
private ApplicationContext context;

@Test
void contextLoads() {
assertNotNull(context);
}

@Test
void configServerBeanExists() {
// ConfigServerConfiguration bean should exist if config server is enabled
assertTrue(context.getBeanNamesForType(org.springframework.cloud.config.server.config.ConfigServerConfiguration.class).length > 0);
}

@Test
void eurekaClientBeanExists() {
// Eureka client bean should exist if Eureka is enabled
assertTrue(context.getBeanNamesForType(org.springframework.cloud.netflix.eureka.EurekaClientConfigBean.class).length > 0);
}

@Test
void mainClassIsLoaded() {
assertNotNull(context.getBean(CloudConfigApplication.class));
}

@Test
void environmentIsNotNull() {
assertNotNull(context.getEnvironment());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.selimhorri.app.unit;

import com.selimhorri.app.CloudConfigApplication;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.lang.annotation.Annotation;
import static org.junit.jupiter.api.Assertions.*;

class CloudConfigApplicationUnitTests {

@Test
void testSpringBootApplicationAnnotationPresent() {
assertTrue(CloudConfigApplication.class.isAnnotationPresent(org.springframework.boot.autoconfigure.SpringBootApplication.class));
}

@Test
void testEnableEurekaClientAnnotationPresent() {
assertTrue(CloudConfigApplication.class.isAnnotationPresent(org.springframework.cloud.netflix.eureka.EnableEurekaClient.class));
}

@Test
void testEnableConfigServerAnnotationPresent() {
assertTrue(CloudConfigApplication.class.isAnnotationPresent(org.springframework.cloud.config.server.EnableConfigServer.class));
}

@Test
void testClassIsPublic() {
assertTrue(java.lang.reflect.Modifier.isPublic(CloudConfigApplication.class.getModifiers()));
}
}
Loading