From 48b6a5e315d6e0e4d9ad8e26d57d3a096652fdf1 Mon Sep 17 00:00:00 2001 From: Pablo de la Torre Jamardo Date: Sat, 21 Feb 2026 10:47:21 +0100 Subject: [PATCH] ci: implements jenkins deploy --- Dockerfile | 6 ++++-- Jenkinsfile | 3 +++ Makefile | 6 +++++- infrastructure/src/main/resources/ddl.sql | 5 ----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6c7e88..6d9f2a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,10 @@ COPY . . RUN mvn clean package -DskipTests # Stage 2: Run -FROM openjdk:21-jdk +#FROM eclipse-temurin:21-jdk +FROM eclipse-temurin:21-jre-alpine WORKDIR /app COPY --from=build /app/bootstrap/target/*.jar app.jar EXPOSE 80 -ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-Xmx512m", "-Xms256m", "-jar", "app.jar"] \ No newline at end of file +#ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-Xmx512m", "-Xms256m", "-jar", "app.jar"] +ENTRYPOINT ["java","-XX:+UseContainerSupport","-XX:MaxRAMPercentage=45.0","-Xms128m","-Xmx256m","-jar","app.jar"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index b753785..7cf137a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,5 +70,8 @@ pipeline { failure { echo "❌ Pipeline failed!" } + always { + deleteDir() + } } } \ No newline at end of file diff --git a/Makefile b/Makefile index 26a9cc4..2df135d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +STACK=pablotj-portfolio APP_NAME=pablotj-portfolio-api IMAGE_NAME=$(APP_NAME) @@ -6,7 +7,7 @@ NAMESPACE=andromeda TAG?=latest HOST_PORT=8181 -CONTAINER_PORT=80 +CONTAINER_PORT=8080 IMAGE_FULL=$(REGISTRY_URL)/$(NAMESPACE)/$(IMAGE_NAME):$(TAG) @@ -22,6 +23,9 @@ push: run: docker run -d \ --name $(APP_NAME) \ + --label com.docker.compose.service="$(APP_NAME)" \ + --label com.docker.compose.project="$(STACK)" \ + --network andromeda \ -p $(HOST_PORT):$(CONTAINER_PORT) \ --env-file .env \ $(IMAGE_FULL) diff --git a/infrastructure/src/main/resources/ddl.sql b/infrastructure/src/main/resources/ddl.sql index aaa34af..48fe643 100644 --- a/infrastructure/src/main/resources/ddl.sql +++ b/infrastructure/src/main/resources/ddl.sql @@ -124,11 +124,6 @@ alter table if exists experience_skill foreign key (experience_id) references experience; -alter table if exists profile_social_link - add constraint FKfh1pbfvvg3palcr1yip6jffik - foreign key (PROFILE_ID) - references profile; - alter table if exists project_feature add constraint FKdifppyvrfito5in15ox4db0up foreign key (project_id)